home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / NETPROG.ZIP;1 / NETPROG.TAR < prev    next >
Tape Archive  |  1992-03-04  |  580.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: NETPROG.TAR

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file tar archive default
99% file tar archive (V7), file ./, mode 40750 , uid 135 , gid 160 , size 0 , seconds 5025726564 default
98% file data default
100% TrID Sybase iAnywhere database files default (weak)
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype Pre-POSIX tar archive default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 2e 2f 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |./......|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 30 20 00 20 20 20 31 |.... 407|50 . 1|
|00000070| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 35 30 32 35 37 32 36 | 0 | 5025726|
|00000090| 35 36 34 20 20 20 34 32 | 34 37 00 20 00 00 00 00 |564 42|47. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 2e 2f 44 49 53 43 4c 41 | 49 4d 45 52 00 00 00 00 |./DISCLA|IMER....|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00000270| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00000280| 20 20 20 31 31 37 33 20 | 20 34 35 34 32 37 32 37 | 1173 | 4542727|
|00000290| 31 33 35 20 20 20 35 36 | 33 30 00 20 00 00 00 00 |135 56|30. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 09 4c 49 4d 49 54 53 20 | 4f 46 20 4c 49 41 42 49 |.LIMITS |OF LIABI|
|00000410| 4c 49 54 59 20 41 4e 44 | 20 44 49 53 43 4c 41 49 |LITY AND| DISCLAI|
|00000420| 4d 45 52 20 4f 46 20 57 | 41 52 52 41 4e 54 59 0a |MER OF W|ARRANTY.|
|00000430| 0a 54 68 65 20 61 75 74 | 68 6f 72 20 61 6e 64 20 |.The aut|hor and |
|00000440| 70 75 62 6c 69 73 68 65 | 72 20 6f 66 20 74 68 65 |publishe|r of the|
|00000450| 20 62 6f 6f 6b 20 22 55 | 4e 49 58 20 4e 65 74 77 | book "U|NIX Netw|
|00000460| 6f 72 6b 20 50 72 6f 67 | 72 61 6d 6d 69 6e 67 22 |ork Prog|ramming"|
|00000470| 0a 68 61 76 65 20 75 73 | 65 64 20 74 68 65 69 72 |.have us|ed their|
|00000480| 20 62 65 73 74 20 65 66 | 66 6f 72 74 73 20 69 6e | best ef|forts in|
|00000490| 20 70 72 65 70 61 72 69 | 6e 67 20 74 68 69 73 20 | prepari|ng this |
|000004a0| 73 6f 66 74 77 61 72 65 | 2e 0a 54 68 65 73 65 20 |software|..These |
|000004b0| 65 66 66 6f 72 74 73 20 | 69 6e 63 6c 75 64 65 20 |efforts |include |
|000004c0| 74 68 65 20 64 65 76 65 | 6c 6f 70 6d 65 6e 74 2c |the deve|lopment,|
|000004d0| 20 72 65 73 65 61 72 63 | 68 2c 20 61 6e 64 20 74 | researc|h, and t|
|000004e0| 65 73 74 69 6e 67 0a 6f | 66 20 74 68 65 20 74 68 |esting.o|f the th|
|000004f0| 65 6f 72 69 65 73 20 61 | 6e 64 20 70 72 6f 67 72 |eories a|nd progr|
|00000500| 61 6d 73 20 74 6f 20 64 | 65 74 65 72 6d 69 6e 65 |ams to d|etermine|
|00000510| 20 74 68 65 69 72 20 65 | 66 66 65 63 74 69 76 65 | their e|ffective|
|00000520| 6e 65 73 73 2e 0a 54 68 | 65 20 61 75 74 68 6f 72 |ness..Th|e author|
|00000530| 20 61 6e 64 20 70 75 62 | 6c 69 73 68 65 72 20 6d | and pub|lisher m|
|00000540| 61 6b 65 20 6e 6f 20 77 | 61 72 72 61 6e 74 79 20 |ake no w|arranty |
|00000550| 6f 66 20 61 6e 79 20 6b | 69 6e 64 2c 20 65 78 70 |of any k|ind, exp|
|00000560| 72 65 73 73 0a 6f 72 20 | 69 6d 70 6c 69 65 64 2c |ress.or |implied,|
|00000570| 20 77 69 74 68 20 72 65 | 67 61 72 64 20 74 6f 20 | with re|gard to |
|00000580| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 20 6f |these pr|ograms o|
|00000590| 72 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 61 74 |r the do|cumentat|
|000005a0| 69 6f 6e 0a 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e |ion.cont|ained in|
|000005b0| 20 74 68 65 20 62 6f 6f | 6b 2e 20 54 68 65 20 61 | the boo|k. The a|
|000005c0| 75 74 68 6f 72 20 61 6e | 64 20 70 75 62 6c 69 73 |uthor an|d publis|
|000005d0| 68 65 72 20 73 68 61 6c | 6c 20 6e 6f 74 20 62 65 |her shal|l not be|
|000005e0| 0a 6c 69 61 62 6c 65 20 | 69 6e 20 61 6e 79 20 65 |.liable |in any e|
|000005f0| 76 65 6e 74 20 66 6f 72 | 20 69 6e 63 69 64 65 6e |vent for| inciden|
|00000600| 74 61 6c 20 6f 72 20 63 | 6f 6e 73 65 71 75 65 6e |tal or c|onsequen|
|00000610| 74 69 61 6c 20 64 61 6d | 61 67 65 73 20 69 6e 0a |tial dam|ages in.|
|00000620| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 77 69 74 68 2c |connecti|on with,|
|00000630| 20 6f 72 20 61 72 69 73 | 69 6e 67 20 6f 75 74 20 | or aris|ing out |
|00000640| 6f 66 2c 20 74 68 65 20 | 66 75 72 6e 69 73 68 69 |of, the |furnishi|
|00000650| 6e 67 2c 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 2c |ng, perf|ormance,|
|00000660| 0a 6f 72 20 75 73 65 20 | 6f 66 20 74 68 65 73 65 |.or use |of these|
|00000670| 20 70 72 6f 67 72 61 6d | 73 2e 0a 74 68 65 69 72 | program|s..their|
|00000680| 20 62 65 73 74 20 65 66 | 66 6f 72 74 73 20 69 6e | best ef|forts in|
|00000690| 20 70 72 65 70 61 72 69 | 6e 67 20 74 68 69 73 20 | prepari|ng this |
|000006a0| 73 6f 66 74 77 61 72 65 | 2e 0a 54 68 65 73 65 20 |software|..These |
|000006b0| 65 66 66 6f 72 74 73 20 | 69 6e 63 6c 75 64 65 20 |efforts |include |
|000006c0| 74 68 65 20 64 65 76 65 | 6c 6f 70 6d 65 6e 74 2c |the deve|lopment,|
|000006d0| 20 72 65 73 65 61 72 63 | 68 2c 20 61 6e 64 20 74 | researc|h, and t|
|000006e0| 65 73 74 69 6e 67 0a 6f | 66 20 74 68 65 20 74 68 |esting.o|f the th|
|000006f0| 65 6f 72 69 65 73 20 61 | 6e 64 20 70 72 6f 67 72 |eories a|nd progr|
|00000700| 61 6d 73 20 74 6f 20 64 | 65 74 65 72 6d 69 6e 65 |ams to d|etermine|
|00000710| 20 74 68 65 69 72 20 65 | 66 66 65 63 74 69 76 65 | their e|ffective|
|00000720| 6e 65 73 73 2e 0a 54 68 | 65 20 61 75 74 68 6f 72 |ness..Th|e author|
|00000730| 20 61 6e 64 20 70 75 62 | 6c 69 73 68 65 72 20 6d | and pub|lisher m|
|00000740| 61 6b 65 20 6e 6f 20 77 | 61 72 72 61 6e 74 79 20 |ake no w|arranty |
|00000750| 6f 66 20 61 6e 79 20 6b | 69 6e 64 2c 20 65 78 70 |of any k|ind, exp|
|00000760| 72 65 73 73 0a 6f 72 20 | 69 6d 70 6c 69 65 64 2c |ress.or |implied,|
|00000770| 20 77 69 74 68 20 72 65 | 67 61 72 64 20 74 6f 20 | with re|gard to |
|00000780| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 20 6f |these pr|ograms o|
|00000790| 72 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 61 74 |r the do|cumentat|
|000007a0| 69 6f 6e 0a 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e |ion.cont|ained in|
|000007b0| 20 74 68 65 20 62 6f 6f | 6b 2e 20 54 68 65 20 61 | the boo|k. The a|
|000007c0| 75 74 68 6f 72 20 61 6e | 64 20 70 75 62 6c 69 73 |uthor an|d publis|
|000007d0| 68 65 72 20 73 68 61 6c | 6c 20 6e 6f 74 20 62 65 |her shal|l not be|
|000007e0| 0a 6c 69 61 62 6c 65 20 | 69 6e 20 61 6e 79 20 65 |.liable |in any e|
|000007f0| 76 65 6e 74 20 66 6f 72 | 20 69 6e 63 69 64 65 6e |vent for| inciden|
|00000800| 2e 2f 52 45 41 44 4d 45 | 00 00 00 00 00 00 00 00 |./README|........|
|00000810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00000870| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00000880| 20 20 31 32 35 37 33 20 | 20 34 35 34 32 37 32 37 | 12573 | 4542727|
|00000890| 31 33 35 20 20 20 35 31 | 37 37 00 20 00 00 00 00 |135 51|77. ....|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 09 54 68 69 73 20 64 69 | 72 65 63 74 6f 72 79 20 |.This di|rectory |
|00000a10| 74 72 65 65 20 63 6f 6d | 70 72 69 73 65 73 20 74 |tree com|prises t|
|00000a20| 68 65 20 73 6f 75 72 63 | 65 20 63 6f 64 65 20 66 |he sourc|e code f|
|00000a30| 72 6f 6d 0a 74 68 65 20 | 62 6f 6f 6b 20 22 55 4e |rom.the |book "UN|
|00000a40| 49 58 20 4e 65 74 77 6f | 72 6b 20 50 72 6f 67 72 |IX Netwo|rk Progr|
|00000a50| 61 6d 6d 69 6e 67 22 20 | 62 79 20 57 2e 20 52 69 |amming" |by W. Ri|
|00000a60| 63 68 61 72 64 20 53 74 | 65 76 65 6e 73 2c 0a 70 |chard St|evens,.p|
|00000a70| 75 62 6c 69 73 68 65 64 | 20 62 79 20 50 72 65 6e |ublished| by Pren|
|00000a80| 74 69 63 65 20 48 61 6c | 6c 2c 20 31 39 39 30 2e |tice Hal|l, 1990.|
|00000a90| 0a 0a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..------|--------|
|00000aa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ab0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ac0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ad0| 2d 2d 2d 2d 2d 2d 2d 0a | 09 4c 49 4d 49 54 53 20 |-------.|.LIMITS |
|00000ae0| 4f 46 20 4c 49 41 42 49 | 4c 49 54 59 20 41 4e 44 |OF LIABI|LITY AND|
|00000af0| 20 44 49 53 43 4c 41 49 | 4d 45 52 20 4f 46 20 57 | DISCLAI|MER OF W|
|00000b00| 41 52 52 41 4e 54 59 0a | 0a 54 68 65 20 61 75 74 |ARRANTY.|.The aut|
|00000b10| 68 6f 72 20 61 6e 64 20 | 70 75 62 6c 69 73 68 65 |hor and |publishe|
|00000b20| 72 20 6f 66 20 74 68 65 | 20 62 6f 6f 6b 20 22 55 |r of the| book "U|
|00000b30| 4e 49 58 20 4e 65 74 77 | 6f 72 6b 20 50 72 6f 67 |NIX Netw|ork Prog|
|00000b40| 72 61 6d 6d 69 6e 67 22 | 0a 68 61 76 65 20 75 73 |ramming"|.have us|
|00000b50| 65 64 20 74 68 65 69 72 | 20 62 65 73 74 20 65 66 |ed their| best ef|
|00000b60| 66 6f 72 74 73 20 69 6e | 20 70 72 65 70 61 72 69 |forts in| prepari|
|00000b70| 6e 67 20 74 68 69 73 20 | 73 6f 66 74 77 61 72 65 |ng this |software|
|00000b80| 2e 0a 54 68 65 73 65 20 | 65 66 66 6f 72 74 73 20 |..These |efforts |
|00000b90| 69 6e 63 6c 75 64 65 20 | 74 68 65 20 64 65 76 65 |include |the deve|
|00000ba0| 6c 6f 70 6d 65 6e 74 2c | 20 72 65 73 65 61 72 63 |lopment,| researc|
|00000bb0| 68 2c 20 61 6e 64 20 74 | 65 73 74 69 6e 67 0a 6f |h, and t|esting.o|
|00000bc0| 66 20 74 68 65 20 74 68 | 65 6f 72 69 65 73 20 61 |f the th|eories a|
|00000bd0| 6e 64 20 70 72 6f 67 72 | 61 6d 73 20 74 6f 20 64 |nd progr|ams to d|
|00000be0| 65 74 65 72 6d 69 6e 65 | 20 74 68 65 69 72 20 65 |etermine| their e|
|00000bf0| 66 66 65 63 74 69 76 65 | 6e 65 73 73 2e 0a 54 68 |ffective|ness..Th|
|00000c00| 65 20 61 75 74 68 6f 72 | 20 61 6e 64 20 70 75 62 |e author| and pub|
|00000c10| 6c 69 73 68 65 72 20 6d | 61 6b 65 20 6e 6f 20 77 |lisher m|ake no w|
|00000c20| 61 72 72 61 6e 74 79 20 | 6f 66 20 61 6e 79 20 6b |arranty |of any k|
|00000c30| 69 6e 64 2c 20 65 78 70 | 72 65 73 73 0a 6f 72 20 |ind, exp|ress.or |
|00000c40| 69 6d 70 6c 69 65 64 2c | 20 77 69 74 68 20 72 65 |implied,| with re|
|00000c50| 67 61 72 64 20 74 6f 20 | 74 68 65 73 65 20 70 72 |gard to |these pr|
|00000c60| 6f 67 72 61 6d 73 20 6f | 72 20 74 68 65 20 64 6f |ograms o|r the do|
|00000c70| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 0a 63 6f 6e 74 |cumentat|ion.cont|
|00000c80| 61 69 6e 65 64 20 69 6e | 20 74 68 65 20 62 6f 6f |ained in| the boo|
|00000c90| 6b 2e 20 54 68 65 20 61 | 75 74 68 6f 72 20 61 6e |k. The a|uthor an|
|00000ca0| 64 20 70 75 62 6c 69 73 | 68 65 72 20 73 68 61 6c |d publis|her shal|
|00000cb0| 6c 20 6e 6f 74 20 62 65 | 0a 6c 69 61 62 6c 65 20 |l not be|.liable |
|00000cc0| 69 6e 20 61 6e 79 20 65 | 76 65 6e 74 20 66 6f 72 |in any e|vent for|
|00000cd0| 20 69 6e 63 69 64 65 6e | 74 61 6c 20 6f 72 20 63 | inciden|tal or c|
|00000ce0| 6f 6e 73 65 71 75 65 6e | 74 69 61 6c 20 64 61 6d |onsequen|tial dam|
|00000cf0| 61 67 65 73 20 69 6e 0a | 63 6f 6e 6e 65 63 74 69 |ages in.|connecti|
|00000d00| 6f 6e 20 77 69 74 68 2c | 20 6f 72 20 61 72 69 73 |on with,| or aris|
|00000d10| 69 6e 67 20 6f 75 74 20 | 6f 66 2c 20 74 68 65 20 |ing out |of, the |
|00000d20| 66 75 72 6e 69 73 68 69 | 6e 67 2c 20 70 65 72 66 |furnishi|ng, perf|
|00000d30| 6f 72 6d 61 6e 63 65 2c | 0a 6f 72 20 75 73 65 20 |ormance,|.or use |
|00000d40| 6f 66 20 74 68 65 73 65 | 20 70 72 6f 67 72 61 6d |of these| program|
|00000d50| 73 2e 0a 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |s..-----|--------|
|00000d60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000d90| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 0a 09 41 73 20 73 74 |--------|...As st|
|00000da0| 61 74 65 64 20 69 6e 20 | 74 68 65 20 50 72 65 66 |ated in |the Pref|
|00000db0| 61 63 65 20 6f 66 20 74 | 68 65 20 62 6f 6f 6b 2c |ace of t|he book,|
|00000dc0| 20 74 68 65 20 73 6f 75 | 72 63 65 20 63 6f 64 65 | the sou|rce code|
|00000dd0| 20 77 61 73 0a 74 65 73 | 74 65 64 20 75 6e 64 65 | was.tes|ted unde|
|00000de0| 72 20 34 2e 33 42 53 44 | 20 6f 6e 20 61 20 56 41 |r 4.3BSD| on a VA|
|00000df0| 58 20 61 6e 64 20 41 54 | 26 54 27 73 20 53 79 73 |X and AT|&T's Sys|
|00000e00| 74 65 6d 20 56 2f 33 38 | 36 20 52 65 6c 65 61 73 |tem V/38|6 Releas|
|00000e10| 65 20 33 2e 32 0a 6f 6e | 20 61 20 43 6f 6d 70 61 |e 3.2.on| a Compa|
|00000e20| 71 20 33 38 36 2f 32 30 | 2e 20 20 54 68 65 72 65 |q 386/20|. There|
|00000e30| 20 6d 61 79 20 62 65 20 | 73 6f 6d 65 20 63 6f 6d | may be |some com|
|00000e40| 6d 65 6e 74 73 20 61 6e | 64 20 4d 61 6b 65 66 69 |ments an|d Makefi|
|00000e50| 6c 65 20 72 75 6c 65 73 | 0a 66 6f 72 20 58 65 6e |le rules|.for Xen|
|00000e60| 69 78 20 73 69 6e 63 65 | 20 49 20 73 74 61 72 74 |ix since| I start|
|00000e70| 65 64 20 70 6f 72 74 69 | 6e 67 20 73 6f 6d 65 20 |ed porti|ng some |
|00000e80| 6f 66 20 74 68 65 20 73 | 6f 66 74 77 61 72 65 20 |of the s|oftware |
|00000e90| 74 6f 20 58 65 6e 69 78 | 2e 0a 48 6f 77 65 76 65 |to Xenix|..Howeve|
|00000ea0| 72 2c 20 49 20 66 6f 75 | 6e 64 20 74 68 65 20 65 |r, I fou|nd the e|
|00000eb0| 78 69 73 74 69 6e 67 20 | 58 65 6e 69 78 20 73 6f |xisting |Xenix so|
|00000ec0| 63 6b 65 74 20 6c 69 62 | 72 61 72 69 65 73 20 73 |cket lib|raries s|
|00000ed0| 6f 20 70 6f 6f 72 20 74 | 68 61 74 0a 49 20 6e 65 |o poor t|hat.I ne|
|00000ee0| 76 65 72 20 66 69 6e 69 | 73 68 65 64 2e 0a 0a 09 |ver fini|shed....|
|00000ef0| 54 6f 20 73 74 61 72 74 | 2c 20 63 68 65 63 6b 20 |To start|, check |
|00000f00| 74 68 65 20 66 69 6c 65 | 73 20 22 73 79 73 74 79 |the file|s "systy|
|00000f10| 70 65 2e 73 68 22 20 61 | 6e 64 20 22 73 79 73 74 |pe.sh" a|nd "syst|
|00000f20| 79 70 65 2e 68 22 0a 69 | 6e 20 65 69 74 68 65 72 |ype.h".i|n either|
|00000f30| 20 74 68 65 20 22 6c 69 | 62 22 20 6f 72 20 22 6c | the "li|b" or "l|
|00000f40| 69 62 2e 73 35 22 20 64 | 69 72 65 63 74 6f 72 79 |ib.s5" d|irectory|
|00000f50| 2e 20 20 54 68 65 73 65 | 20 6d 61 79 20 68 61 76 |. These| may hav|
|00000f60| 65 20 74 6f 0a 62 65 20 | 6d 6f 64 69 66 69 65 64 |e to.be |modified|
|00000f70| 20 66 6f 72 20 79 6f 75 | 72 20 73 79 73 74 65 6d | for you|r system|
|00000f80| 2e 20 20 4e 65 78 74 2c | 20 64 6f 20 61 20 22 6d |. Next,| do a "m|
|00000f90| 61 6b 65 22 20 69 6e 20 | 65 69 74 68 65 72 20 6f |ake" in |either o|
|00000fa0| 66 0a 74 68 65 73 65 20 | 64 69 72 65 63 74 6f 72 |f.these |director|
|00000fb0| 69 65 73 20 74 6f 20 6d | 61 6b 65 20 74 68 65 20 |ies to m|ake the |
|00000fc0| 6c 69 62 72 61 72 79 20 | 22 6c 69 62 6e 65 74 2e |library |"libnet.|
|00000fd0| 61 22 2e 20 20 54 68 69 | 73 20 6c 69 62 72 61 72 |a". Thi|s librar|
|00000fe0| 79 0a 69 73 20 72 65 71 | 75 69 72 65 64 20 74 6f |y.is req|uired to|
|00000ff0| 20 6d 61 6b 65 20 6d 6f | 73 74 20 6f 66 20 74 68 | make mo|st of th|
|00001000| 65 20 6f 74 68 65 72 20 | 70 72 6f 67 72 61 6d 73 |e other |programs|
|00001010| 20 28 6d 69 6e 69 6d 61 | 6c 6c 79 20 62 65 63 61 | (minima|lly beca|
|00001020| 75 73 65 0a 74 68 65 20 | 65 72 72 6f 72 20 66 75 |use.the |error fu|
|00001030| 6e 63 74 69 6f 6e 73 20 | 2d 20 65 72 72 5f 58 58 |nctions |- err_XX|
|00001040| 58 28 29 20 2d 20 61 72 | 65 20 69 6e 20 74 68 69 |X() - ar|e in thi|
|00001050| 73 20 6c 69 62 72 61 72 | 79 20 61 6e 64 20 74 68 |s librar|y and th|
|00001060| 65 73 65 0a 65 72 72 6f | 72 20 66 75 6e 63 74 69 |ese.erro|r functi|
|00001070| 6f 6e 73 20 61 72 65 20 | 75 73 65 64 20 62 79 20 |ons are |used by |
|00001080| 61 6c 6d 6f 73 74 20 65 | 76 65 72 79 20 70 72 6f |almost e|very pro|
|00001090| 67 72 61 6d 29 2e 0a 0a | 09 4e 6f 74 65 20 74 68 |gram)...|.Note th|
|000010a0| 61 74 20 74 68 65 72 65 | 20 61 72 65 20 61 20 6c |at there| are a l|
|000010b0| 6f 74 20 6f 66 20 6c 69 | 6e 6b 73 20 62 65 74 77 |ot of li|nks betw|
|000010c0| 65 65 6e 20 66 69 6c 65 | 73 20 69 6e 0a 64 69 66 |een file|s in.dif|
|000010d0| 66 65 72 65 6e 74 20 64 | 69 72 65 63 74 6f 72 69 |ferent d|irectori|
|000010e0| 65 73 2e 20 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 |es. For| example|
|000010f0| 2c 20 74 68 65 20 64 69 | 72 65 63 74 6f 72 69 65 |, the di|rectorie|
|00001100| 73 20 22 66 64 22 20 61 | 6e 64 20 22 66 64 2e 73 |s "fd" a|nd "fd.s|
|00001110| 35 22 0a 62 6f 74 68 20 | 75 73 65 20 74 68 65 20 |5".both |use the |
|00001120| 73 61 6d 65 20 4d 61 6b | 65 66 69 6c 65 20 61 6e |same Mak|efile an|
|00001130| 64 20 6d 61 69 6e 20 70 | 72 6f 67 72 61 6d 73 2e |d main p|rograms.|
|00001140| 20 20 4f 6e 6c 79 20 74 | 68 65 20 66 69 6c 65 73 | Only t|he files|
|00001150| 0a 22 73 65 6e 64 66 69 | 6c 65 2e 63 22 20 61 6e |."sendfi|le.c" an|
|00001160| 64 20 22 72 65 63 76 66 | 69 6c 65 2e 63 22 20 69 |d "recvf|ile.c" i|
|00001170| 6e 20 74 68 65 73 65 20 | 64 69 72 65 63 74 6f 72 |n these |director|
|00001180| 69 65 73 20 61 72 65 20 | 64 69 66 66 65 72 65 6e |ies are |differen|
|00001190| 74 0a 62 65 74 77 65 65 | 6e 20 34 2e 33 42 53 44 |t.betwee|n 4.3BSD|
|000011a0| 20 61 6e 64 20 53 79 73 | 74 65 6d 20 56 2e 0a 0a | and Sys|tem V...|
|000011b0| 09 54 68 65 20 64 69 72 | 65 63 74 6f 72 69 65 73 |.The dir|ectories|
|000011c0| 20 61 72 65 20 61 73 20 | 66 6f 6c 6c 6f 77 73 3a | are as |follows:|
|000011d0| 0a 0a 61 73 79 6e 63 69 | 6f 09 09 54 68 65 20 61 |..asynci|o..The a|
|000011e0| 73 79 6e 63 68 72 6f 6e | 6f 75 73 20 49 2f 4f 20 |synchron|ous I/O |
|000011f0| 65 78 61 6d 70 6c 65 20 | 66 72 6f 6d 20 53 65 63 |example |from Sec|
|00001200| 74 69 6f 6e 20 36 2e 31 | 32 2e 0a 0a 66 64 09 09 |tion 6.1|2...fd..|
|00001210| 54 68 65 20 66 69 6c 65 | 20 64 65 73 63 72 69 70 |The file| descrip|
|00001220| 74 6f 72 20 70 61 73 73 | 69 6e 67 20 65 78 61 6d |tor pass|ing exam|
|00001230| 70 6c 65 20 66 6f 72 20 | 34 2e 33 42 53 44 20 66 |ple for |4.3BSD f|
|00001240| 72 6f 6d 0a 09 09 53 65 | 63 74 69 6f 6e 20 36 2e |rom...Se|ction 6.|
|00001250| 31 30 2e 0a 0a 66 64 2e | 73 35 09 09 54 68 65 20 |10...fd.|s5..The |
|00001260| 66 69 6c 65 20 64 65 73 | 63 72 69 70 74 6f 72 20 |file des|criptor |
|00001270| 70 61 73 73 69 6e 67 20 | 65 78 61 6d 70 6c 65 20 |passing |example |
|00001280| 66 6f 72 20 53 79 73 74 | 65 6d 20 56 0a 09 09 66 |for Syst|em V...f|
|00001290| 72 6f 6d 20 53 65 63 74 | 69 6f 6e 20 37 2e 31 30 |rom Sect|ion 7.10|
|000012a0| 2e 0a 0a 69 6e 65 74 74 | 69 6d 65 09 54 68 65 20 |...inett|ime.The |
|000012b0| 49 6e 74 65 72 6e 65 74 | 20 74 69 6d 65 20 61 6e |Internet| time an|
|000012c0| 64 20 64 61 79 74 69 6d | 65 20 63 6c 69 65 6e 74 |d daytim|e client|
|000012d0| 73 20 66 72 6f 6d 20 53 | 65 63 74 69 6f 6e 20 31 |s from S|ection 1|
|000012e0| 30 2e 32 2e 0a 0a 69 70 | 63 09 09 54 68 65 20 49 |0.2...ip|c..The I|
|000012f0| 50 43 20 65 78 61 6d 70 | 6c 65 73 20 66 72 6f 6d |PC examp|les from|
|00001300| 20 43 68 61 70 74 65 72 | 20 33 2e 0a 0a 6c 69 62 | Chapter| 3...lib|
|00001310| 09 09 54 68 65 20 6c 69 | 62 72 61 72 79 20 6f 66 |..The li|brary of|
|00001320| 20 63 6f 6d 6d 6f 6e 20 | 66 75 6e 63 74 69 6f 6e | common |function|
|00001330| 73 20 66 6f 72 20 34 2e | 33 42 53 44 2e 20 20 54 |s for 4.|3BSD. T|
|00001340| 68 65 73 65 20 66 75 6e | 63 74 69 6f 6e 73 0a 09 |hese fun|ctions..|
|00001350| 09 63 6f 6d 65 20 66 72 | 6f 6d 20 61 6c 6c 20 6f |.come fr|om all o|
|00001360| 76 65 72 20 74 68 65 20 | 62 6f 6f 6b 2e 20 20 53 |ver the |book. S|
|00001370| 70 65 63 69 66 69 63 61 | 6c 6c 79 3a 0a 0a 09 6c |pecifica|lly:...l|
|00001380| 69 62 2f 64 61 65 6d 6f | 6e 2e 63 09 09 64 61 65 |ib/daemo|n.c..dae|
|00001390| 6d 6f 6e 5f 73 74 61 72 | 74 28 29 20 66 75 6e 63 |mon_star|t() func|
|000013a0| 74 69 6f 6e 20 2d 20 53 | 65 63 2e 20 32 2e 36 2e |tion - S|ec. 2.6.|
|000013b0| 0a 09 6c 69 62 2f 64 67 | 73 65 6e 64 72 65 63 76 |..lib/dg|sendrecv|
|000013c0| 2e 63 09 52 65 6c 69 61 | 62 6c 65 20 6d 65 73 73 |.c.Relia|ble mess|
|000013d0| 61 67 65 20 73 65 6e 64 | 2f 72 65 63 65 69 76 65 |age send|/receive|
|000013e0| 20 2d 20 53 65 63 2e 20 | 38 2e 34 2e 0a 09 6c 69 | - Sec. |8.4...li|
|000013f0| 62 2f 65 72 72 6f 72 2e | 63 09 09 45 72 72 6f 72 |b/error.|c..Error|
|00001400| 20 68 61 6e 64 6c 69 6e | 67 20 2d 20 41 70 70 65 | handlin|g - Appe|
|00001410| 6e 64 69 78 20 41 2e 33 | 2e 0a 09 6c 69 62 2f 68 |ndix A.3|...lib/h|
|00001420| 6f 73 74 65 72 72 6f 72 | 2e 63 09 09 53 65 63 2e |osterror|.c..Sec.|
|00001430| 20 41 2e 33 2e 0a 09 6c | 69 62 2f 69 64 70 6f 70 | A.3...l|ib/idpop|
|00001440| 65 6e 2e 63 09 09 53 65 | 63 2e 20 38 2e 33 2e 0a |en.c..Se|c. 8.3..|
|00001450| 09 6c 69 62 2f 6c 6f 63 | 6b 2e 63 09 09 4c 6f 63 |.lib/loc|k.c..Loc|
|00001460| 6b 20 66 75 6e 63 74 69 | 6f 6e 73 20 66 6f 72 20 |k functi|ons for |
|00001470| 6c 70 72 2f 73 65 71 6e | 6f 2e 63 20 2d 20 53 65 |lpr/seqn|o.c - Se|
|00001480| 63 2e 20 31 33 2e 33 2e | 0a 09 6c 69 62 2f 6e 65 |c. 13.3.|..lib/ne|
|00001490| 74 64 65 66 73 2e 68 09 | 09 55 73 65 64 20 62 79 |tdefs.h.|.Used by|
|000014a0| 20 6c 69 62 2f 58 58 58 | 6f 70 65 6e 2e 63 20 61 | lib/XXX|open.c a|
|000014b0| 6e 64 20 74 66 74 70 2f | 6e 65 74 58 58 58 2e 63 |nd tftp/|netXXX.c|
|000014c0| 2e 0a 09 6c 69 62 2f 6e | 73 70 69 70 65 2e 63 09 |...lib/n|spipe.c.|
|000014d0| 09 4e 61 6d 65 64 20 73 | 74 72 65 61 6d 20 70 69 |.Named s|tream pi|
|000014e0| 70 65 20 66 75 6e 63 74 | 69 6f 6e 20 2d 20 53 65 |pe funct|ion - Se|
|000014f0| 63 2e 20 36 2e 39 2e 0a | 09 6c 69 62 2f 70 74 79 |c. 6.9..|.lib/pty|
|00001500| 2e 63 09 09 50 73 65 75 | 64 6f 20 74 74 79 20 72 |.c..Pseu|do tty r|
|00001510| 6f 75 74 69 6e 65 73 20 | 2d 20 53 65 63 2e 20 31 |outines |- Sec. 1|
|00001520| 35 2e 34 2e 0a 09 6c 69 | 62 2f 72 65 61 64 6c 69 |5.4...li|b/readli|
|00001530| 6e 65 2e 63 09 09 53 65 | 63 2e 20 36 2e 36 2e 0a |ne.c..Se|c. 6.6..|
|00001540| 09 6c 69 62 2f 72 65 61 | 64 6e 2e 63 09 09 53 65 |.lib/rea|dn.c..Se|
|00001550| 63 2e 20 36 2e 36 2e 0a | 09 6c 69 62 2f 72 72 65 |c. 6.6..|.lib/rre|
|00001560| 73 76 70 6f 72 74 2e 63 | 09 09 28 4e 6f 74 20 69 |svport.c|..(Not i|
|00001570| 6e 20 62 6f 6f 6b 3b 20 | 6e 65 65 64 65 64 20 66 |n book; |needed f|
|00001580| 6f 72 20 57 49 4e 2f 54 | 43 50 29 0a 09 6c 69 62 |or WIN/T|CP)..lib|
|00001590| 2f 72 74 74 2e 63 09 09 | 52 6f 75 6e 64 2d 74 72 |/rtt.c..|Round-tr|
|000015a0| 69 70 20 74 69 6d 69 6e | 67 20 66 75 6e 63 74 69 |ip timin|g functi|
|000015b0| 6f 6e 73 20 2d 20 53 65 | 63 2e 20 38 2e 34 2e 0a |ons - Se|c. 8.4..|
|000015c0| 09 6c 69 62 2f 73 69 67 | 63 68 69 6c 64 2e 63 09 |.lib/sig|child.c.|
|000015d0| 09 64 61 65 6d 6f 6e 5f | 73 74 61 72 74 28 29 20 |.daemon_|start() |
|000015e0| 53 49 47 43 4c 44 20 68 | 61 6e 64 6c 65 72 20 2d |SIGCLD h|andler -|
|000015f0| 20 53 65 63 2e 20 32 2e | 36 2e 0a 09 6c 69 62 2f | Sec. 2.|6...lib/|
|00001600| 73 70 69 70 65 2e 63 09 | 09 53 74 72 65 61 6d 20 |spipe.c.|.Stream |
|00001610| 70 69 70 65 20 66 75 6e | 63 74 69 6f 6e 20 2d 20 |pipe fun|ction - |
|00001620| 53 65 63 2e 20 36 2e 39 | 2e 0a 09 6c 69 62 2f 73 |Sec. 6.9|...lib/s|
|00001630| 70 70 6f 70 65 6e 2e 63 | 09 09 53 65 63 2e 20 38 |ppopen.c|..Sec. 8|
|00001640| 2e 33 2e 0a 09 6c 69 62 | 2f 74 63 70 6f 70 65 6e |.3...lib|/tcpopen|
|00001650| 2e 63 09 09 53 65 63 2e | 20 38 2e 33 2e 0a 09 6c |.c..Sec.| 8.3...l|
|00001660| 69 62 2f 74 69 6d 65 72 | 2e 63 09 09 54 69 6d 69 |ib/timer|.c..Timi|
|00001670| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 20 75 73 65 |ng funct|ions use|
|00001680| 64 20 69 6e 20 54 46 54 | 50 20 2d 20 41 70 70 2e |d in TFT|P - App.|
|00001690| 20 41 2e 34 2e 0a 09 6c | 69 62 2f 74 74 79 6d 6f | A.4...l|ib/ttymo|
|000016a0| 64 65 2e 63 09 09 43 6f | 70 79 20 74 65 72 6d 69 |de.c..Co|py termi|
|000016b0| 6e 61 6c 20 6d 6f 64 65 | 20 2d 20 53 65 63 2e 20 |nal mode| - Sec. |
|000016c0| 31 35 2e 35 2e 0a 09 6c | 69 62 2f 74 74 79 72 61 |15.5...l|ib/ttyra|
|000016d0| 77 2e 63 09 09 53 65 74 | 20 74 65 72 6d 69 6e 61 |w.c..Set| termina|
|000016e0| 6c 20 72 61 77 20 6d 6f | 64 65 20 2d 20 53 65 63 |l raw mo|de - Sec|
|000016f0| 2e 20 31 35 2e 35 2e 0a | 09 6c 69 62 2f 75 64 70 |. 15.5..|.lib/udp|
|00001700| 6f 70 65 6e 2e 63 09 09 | 53 65 63 2e 20 38 2e 33 |open.c..|Sec. 8.3|
|00001710| 2e 0a 09 6c 69 62 2f 77 | 72 69 74 65 6e 2e 63 09 |...lib/w|riten.c.|
|00001720| 09 53 65 63 2e 20 36 2e | 36 2e 0a 0a 6c 69 62 2e |.Sec. 6.|6...lib.|
|00001730| 73 35 09 09 54 68 65 20 | 6c 69 62 72 61 72 79 20 |s5..The |library |
|00001740| 6f 66 20 63 6f 6d 6d 6f | 6e 20 66 75 6e 63 74 69 |of commo|n functi|
|00001750| 6f 6e 73 20 66 6f 72 20 | 53 79 73 74 65 6d 20 56 |ons for |System V|
|00001760| 2e 0a 09 09 53 65 65 20 | 74 68 65 20 6c 69 73 74 |....See |the list|
|00001770| 20 61 62 6f 76 65 20 66 | 6f 72 20 74 68 65 20 22 | above f|or the "|
|00001780| 6c 69 62 22 20 64 69 72 | 65 63 74 6f 72 79 2e 20 |lib" dir|ectory. |
|00001790| 20 54 68 65 20 64 69 66 | 66 65 72 65 6e 63 65 73 | The dif|ferences|
|000017a0| 0a 09 09 61 72 65 3a 20 | 69 64 70 6f 70 65 6e 2e |...are: |idpopen.|
|000017b0| 63 2c 20 73 70 70 6f 70 | 65 6e 2e 63 2c 20 61 6e |c, sppop|en.c, an|
|000017c0| 64 20 73 69 67 63 68 69 | 6c 64 2e 63 20 61 72 65 |d sigchi|ld.c are|
|000017d0| 6e 27 74 20 69 6e 20 22 | 6c 69 62 2e 73 35 22 0a |n't in "|lib.s5".|
|000017e0| 09 09 61 6e 64 20 22 6c | 69 62 2e 73 35 22 20 63 |..and "l|ib.s5" c|
|000017f0| 6f 6e 74 61 69 6e 73 20 | 73 65 6d 61 70 68 2e 63 |ontains |semaph.c|
|00001800| 20 28 74 68 65 20 73 69 | 6d 70 6c 65 72 20 73 65 | (the si|mpler se|
|00001810| 6d 61 70 68 6f 72 65 0a | 09 09 6f 70 65 72 61 74 |maphore.|..operat|
|00001820| 69 6f 6e 73 20 2d 20 53 | 65 63 2e 20 33 2e 31 30 |ions - S|ec. 3.10|
|00001830| 29 2e 0a 0a 6c 6f 63 6b | 09 09 54 68 65 20 72 65 |)...lock|..The re|
|00001840| 63 6f 72 64 20 6c 6f 63 | 6b 69 6e 67 20 61 6e 64 |cord loc|king and|
|00001850| 20 66 69 6c 65 20 6c 6f | 63 6b 69 6e 67 20 66 75 | file lo|cking fu|
|00001860| 6e 63 74 69 6f 6e 73 20 | 66 72 6f 6d 0a 09 09 53 |nctions |from...S|
|00001870| 65 63 74 69 6f 6e 20 33 | 2e 32 2e 0a 0a 6c 70 72 |ection 3|.2...lpr|
|00001880| 09 09 54 68 65 20 34 2e | 33 42 53 44 20 6c 69 6e |..The 4.|3BSD lin|
|00001890| 65 20 70 72 69 6e 74 65 | 72 20 63 6c 69 65 6e 74 |e printe|r client|
|000018a0| 20 2d 20 53 65 63 74 69 | 6f 6e 20 31 33 2e 33 2e | - Secti|on 13.3.|
|000018b0| 0a 0a 6e 65 74 09 09 54 | 68 65 20 73 69 6d 70 6c |..net..T|he simpl|
|000018c0| 65 20 63 6c 69 65 6e 74 | 2d 73 65 72 76 65 72 20 |e client|-server |
|000018d0| 65 78 61 6d 70 6c 65 73 | 20 66 72 6f 6d 20 53 65 |examples| from Se|
|000018e0| 63 74 69 6f 6e 20 36 2e | 36 2e 0a 09 09 41 6c 73 |ction 6.|6....Als|
|000018f0| 6f 20 74 68 65 20 73 6f | 63 6b 65 74 20 6f 70 74 |o the so|cket opt|
|00001900| 69 6f 6e 20 65 78 61 6d | 70 6c 65 20 66 72 6f 6d |ion exam|ple from|
|00001910| 20 53 65 63 74 69 6f 6e | 20 36 2e 31 31 20 61 6e | Section| 6.11 an|
|00001920| 64 0a 09 09 74 68 65 20 | 68 6f 73 74 20 65 6e 74 |d...the |host ent|
|00001930| 72 79 20 65 78 61 6d 70 | 6c 65 20 66 72 6f 6d 20 |ry examp|le from |
|00001940| 53 65 63 74 69 6f 6e 20 | 38 2e 32 2e 0a 0a 6e 65 |Section |8.2...ne|
|00001950| 74 2e 73 35 09 09 54 68 | 65 20 73 69 6d 70 6c 65 |t.s5..Th|e simple|
|00001960| 20 63 6c 69 65 6e 74 2d | 73 65 72 76 65 72 20 65 | client-|server e|
|00001970| 78 61 6d 70 6c 65 73 20 | 66 72 6f 6d 20 53 65 63 |xamples |from Sec|
|00001980| 74 69 6f 6e 20 37 2e 36 | 2e 0a 09 09 41 6c 73 6f |tion 7.6|....Also|
|00001990| 20 63 6f 6e 74 61 69 6e | 73 20 61 20 70 72 6f 67 | contain|s a prog|
|000019a0| 72 61 6d 20 74 6f 20 70 | 72 69 6e 74 20 61 6c 6c |ram to p|rint all|
|000019b0| 20 74 68 65 20 73 74 72 | 65 61 6d 20 6d 6f 64 75 | the str|eam modu|
|000019c0| 6c 65 73 0a 09 09 6f 6e | 20 61 20 67 69 76 65 6e |les...on| a given|
|000019d0| 20 73 74 72 65 61 6d 2c | 20 61 6e 64 20 61 20 70 | stream,| and a p|
|000019e0| 72 6f 67 72 61 6d 20 74 | 6f 20 70 72 69 6e 74 20 |rogram t|o print |
|000019f0| 61 6c 6c 20 74 68 65 0a | 09 09 54 4c 49 20 22 73 |all the.|..TLI "s|
|00001a00| 74 72 75 63 74 20 74 5f | 69 6e 66 6f 22 20 76 61 |truct t_|info" va|
|00001a10| 6c 75 65 73 20 66 6f 72 | 20 79 6f 75 72 20 69 6d |lues for| your im|
|00001a20| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 2e 0a 0a 6e |plementa|tion...n|
|00001a30| 73 70 69 70 65 2e 73 35 | 09 54 68 65 20 6e 61 6d |spipe.s5|.The nam|
|00001a40| 65 64 20 73 74 72 65 61 | 6d 20 70 69 70 65 20 65 |ed strea|m pipe e|
|00001a50| 78 61 6d 70 6c 65 20 66 | 72 6f 6d 20 53 65 63 74 |xample f|rom Sect|
|00001a60| 69 6f 6e 20 37 2e 39 2e | 0a 0a 70 69 6e 67 09 09 |ion 7.9.|..ping..|
|00001a70| 54 68 65 20 34 2e 33 42 | 53 44 20 49 6e 74 65 72 |The 4.3B|SD Inter|
|00001a80| 6e 65 74 20 70 69 6e 67 | 20 70 72 6f 67 72 61 6d |net ping| program|
|00001a90| 20 66 72 6f 6d 20 53 65 | 63 74 69 6f 6e 20 31 31 | from Se|ction 11|
|00001aa0| 2e 32 2e 0a 0a 72 63 6d | 64 09 09 54 68 65 20 72 |.2...rcm|d..The r|
|00001ab0| 63 6d 64 28 29 20 66 75 | 6e 63 74 69 6f 6e 20 61 |cmd() fu|nction a|
|00001ac0| 6e 64 20 69 74 73 20 72 | 73 68 64 20 73 65 72 76 |nd its r|shd serv|
|00001ad0| 65 72 20 66 72 6f 6d 0a | 09 09 53 65 63 74 69 6f |er from.|..Sectio|
|00001ae0| 6e 20 31 34 2e 33 2e 20 | 20 41 6c 73 6f 20 74 68 |n 14.3. | Also th|
|00001af0| 65 20 72 75 73 65 72 6f | 6b 28 29 20 66 75 6e 63 |e rusero|k() func|
|00001b00| 74 69 6f 6e 20 66 72 6f | 6d 0a 09 09 53 65 63 74 |tion fro|m...Sect|
|00001b10| 69 6f 6e 20 39 2e 32 2e | 0a 0a 72 65 63 6f 72 64 |ion 9.2.|..record|
|00001b20| 09 09 54 68 65 20 72 65 | 63 6f 72 64 69 6e 67 20 |..The re|cording |
|00001b30| 65 78 61 6d 70 6c 65 20 | 66 72 6f 6d 20 53 65 63 |example |from Sec|
|00001b40| 74 69 6f 6e 73 20 31 35 | 2e 33 20 2d 20 31 35 2e |tions 15|.3 - 15.|
|00001b50| 36 2e 0a 0a 72 65 63 6f | 72 64 2e 73 35 09 54 68 |6...reco|rd.s5.Th|
|00001b60| 65 20 53 79 73 74 65 6d | 20 56 20 76 65 72 73 69 |e System| V versi|
|00001b70| 6f 6e 20 6f 66 20 74 68 | 65 20 72 65 63 6f 72 64 |on of th|e record|
|00001b80| 69 6e 67 20 65 78 61 6d | 70 6c 65 2e 0a 0a 72 65 |ing exam|ple...re|
|00001b90| 6c 69 61 62 6c 65 09 54 | 68 65 20 72 65 6c 69 61 |liable.T|he relia|
|00001ba0| 62 6c 65 20 6d 65 73 73 | 61 67 65 20 63 6c 69 65 |ble mess|age clie|
|00001bb0| 6e 74 20 61 6e 64 20 73 | 65 72 76 65 72 20 66 72 |nt and s|erver fr|
|00001bc0| 6f 6d 20 53 65 63 74 69 | 6f 6e 20 38 2e 34 2e 0a |om Secti|on 8.4..|
|00001bd0| 0a 72 6c 6f 67 69 6e 09 | 09 54 68 65 20 34 2e 33 |.rlogin.|.The 4.3|
|00001be0| 42 53 44 20 72 6c 6f 67 | 69 6e 20 63 6c 69 65 6e |BSD rlog|in clien|
|00001bf0| 74 20 61 6e 64 20 72 6c | 6f 67 69 6e 64 20 73 65 |t and rl|ogind se|
|00001c00| 72 76 65 72 20 66 72 6f | 6d 0a 09 09 53 65 63 74 |rver fro|m...Sect|
|00001c10| 69 6f 6e 73 20 31 35 2e | 31 31 20 61 6e 64 20 31 |ions 15.|11 and 1|
|00001c20| 35 2e 31 32 2e 0a 0a 72 | 6d 74 09 09 54 68 65 20 |5.12...r|mt..The |
|00001c30| 72 65 6d 6f 74 65 20 74 | 61 70 65 20 73 65 72 76 |remote t|ape serv|
|00001c40| 65 72 20 66 72 6f 6d 20 | 53 65 63 74 69 6f 6e 20 |er from |Section |
|00001c50| 31 36 2e 34 2e 0a 0a 72 | 70 63 2e 63 6f 75 72 69 |16.4...r|pc.couri|
|00001c60| 65 72 2f 74 69 6d 65 64 | 61 74 65 09 54 68 65 20 |er/timed|ate.The |
|00001c70| 58 65 72 6f 78 20 43 6f | 75 72 69 65 72 20 52 50 |Xerox Co|urier RP|
|00001c80| 43 20 65 78 61 6d 70 6c | 65 20 66 72 6f 6d 20 53 |C exampl|e from S|
|00001c90| 65 63 74 69 6f 6e 20 31 | 38 2e 34 2e 0a 09 09 09 |ection 1|8.4.....|
|00001ca0| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 20 4d 61 |Note tha|t the Ma|
|00001cb0| 6b 65 66 69 6c 65 20 77 | 69 6c 6c 20 63 65 72 74 |kefile w|ill cert|
|00001cc0| 61 69 6e 6c 79 20 68 61 | 76 65 20 74 6f 20 62 65 |ainly ha|ve to be|
|00001cd0| 0a 09 09 09 6d 6f 64 69 | 66 69 65 64 2c 20 64 65 |....modi|fied, de|
|00001ce0| 70 65 6e 64 69 6e 67 20 | 77 68 65 72 65 20 79 6f |pending |where yo|
|00001cf0| 75 20 68 61 76 65 20 69 | 6e 73 74 61 6c 6c 65 64 |u have i|nstalled|
|00001d00| 20 74 68 65 0a 09 09 09 | 43 6f 75 72 69 65 72 20 | the....|Courier |
|00001d10| 63 6f 6d 70 69 6c 65 72 | 2c 20 6c 69 62 72 61 72 |compiler|, librar|
|00001d20| 79 2c 20 61 6e 64 20 69 | 6e 63 6c 75 64 65 20 66 |y, and i|nclude f|
|00001d30| 69 6c 65 73 2e 0a 0a 72 | 70 63 2e 73 75 6e 2f 74 |iles...r|pc.sun/t|
|00001d40| 69 6d 65 64 61 74 65 09 | 54 68 65 20 53 75 6e 20 |imedate.|The Sun |
|00001d50| 52 50 43 20 65 78 61 6d | 70 6c 65 20 66 72 6f 6d |RPC exam|ple from|
|00001d60| 20 53 65 63 74 69 6f 6e | 20 31 38 2e 33 2e 0a 09 | Section| 18.3...|
|00001d70| 09 09 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 |..Note t|hat the |
|00001d80| 4d 61 6b 65 66 69 6c 65 | 20 77 69 6c 6c 20 63 65 |Makefile| will ce|
|00001d90| 72 74 61 69 6e 6c 79 20 | 68 61 76 65 20 74 6f 20 |rtainly |have to |
|00001da0| 62 65 0a 09 09 09 6d 6f | 64 69 66 69 65 64 2c 20 |be....mo|dified, |
|00001db0| 64 65 70 65 6e 64 69 6e | 67 20 77 68 65 72 65 20 |dependin|g where |
|00001dc0| 79 6f 75 20 68 61 76 65 | 20 69 6e 73 74 61 6c 6c |you have| install|
|00001dd0| 65 64 20 74 68 65 0a 09 | 09 09 53 75 6e 20 52 50 |ed the..|..Sun RP|
|00001de0| 43 20 63 6f 6d 70 69 6c | 65 72 20 61 6e 64 20 6c |C compil|er and l|
|00001df0| 69 62 72 61 72 79 2e 0a | 0a 73 65 6c 65 63 74 09 |ibrary..|.select.|
|00001e00| 09 54 68 65 20 68 69 67 | 68 65 72 20 70 72 65 63 |.The hig|her prec|
|00001e10| 69 73 69 6f 6e 20 74 69 | 6d 65 72 2c 20 75 73 69 |ision ti|mer, usi|
|00001e20| 6e 67 20 74 68 65 20 73 | 65 6c 65 63 74 20 73 79 |ng the s|elect sy|
|00001e30| 73 74 65 6d 0a 09 09 63 | 61 6c 6c 2c 20 66 72 6f |stem...c|all, fro|
|00001e40| 6d 20 53 65 63 74 69 6f | 6e 20 36 2e 31 33 2e 0a |m Sectio|n 6.13..|
|00001e50| 0a 74 66 74 70 09 09 54 | 68 65 20 54 46 54 50 20 |.tftp..T|he TFTP |
|00001e60| 63 6c 69 65 6e 74 20 61 | 6e 64 20 73 65 72 76 65 |client a|nd serve|
|00001e70| 72 20 66 72 6f 6d 20 43 | 68 61 70 74 65 72 20 31 |r from C|hapter 1|
|00001e80| 32 2e 0a 0a 78 6e 73 65 | 63 68 6f 09 09 54 68 65 |2...xnse|cho..The|
|00001e90| 20 58 4e 53 20 49 44 50 | 20 65 63 68 6f 20 63 6c | XNS IDP| echo cl|
|00001ea0| 69 65 6e 74 20 66 72 6f | 6d 20 53 65 63 74 69 6f |ient fro|m Sectio|
|00001eb0| 6e 20 31 31 2e 33 2e 0a | 0a 09 50 6c 65 61 73 65 |n 11.3..|..Please|
|00001ec0| 20 73 65 6e 64 20 6d 65 | 20 61 6e 79 20 62 75 67 | send me| any bug|
|00001ed0| 20 66 69 78 65 73 2c 20 | 63 6f 6d 6d 65 6e 74 73 | fixes, |comments|
|00001ee0| 2c 20 73 75 67 67 65 73 | 74 69 6f 6e 73 2c 20 65 |, sugges|tions, e|
|00001ef0| 74 63 2e 0a 0a 09 09 52 | 69 63 68 61 72 64 20 53 |tc.....R|ichard S|
|00001f00| 74 65 76 65 6e 73 0a 09 | 09 48 65 61 6c 74 68 20 |tevens..|.Health |
|00001f10| 53 79 73 74 65 6d 73 20 | 49 6e 74 65 72 6e 61 74 |Systems |Internat|
|00001f20| 69 6f 6e 61 6c 2c 20 4e | 65 77 20 48 61 76 65 6e |ional, N|ew Haven|
|00001f30| 2c 20 43 54 0a 09 09 20 | 20 20 73 74 65 76 65 6e |, CT... | steven|
|00001f40| 73 40 68 73 69 2e 63 6f | 6d 0a 09 20 20 20 20 20 |s@hsi.co|m.. |
|00001f50| 20 20 20 20 20 20 2e 2e | 2e 20 7b 20 75 75 6e 65 | ..|. { uune|
|00001f60| 74 20 7c 20 79 61 6c 65 | 20 7d 20 21 20 68 73 69 |t | yale| } ! hsi|
|00001f70| 20 21 20 73 74 65 76 65 | 6e 73 0a 20 74 68 65 20 | ! steve|ns. the |
|00001f80| 4d 61 6b 65 66 69 6c 65 | 20 77 69 6c 6c 20 63 65 |Makefile| will ce|
|00001f90| 72 74 61 69 6e 6c 79 20 | 68 61 76 65 20 74 6f 20 |rtainly |have to |
|00001fa0| 62 65 0a 09 09 09 6d 6f | 64 69 66 69 65 64 2c 20 |be....mo|dified, |
|00001fb0| 64 65 70 65 6e 64 69 6e | 67 20 77 68 65 72 65 20 |dependin|g where |
|00001fc0| 79 6f 75 20 68 61 76 65 | 20 69 6e 73 74 61 6c 6c |you have| install|
|00001fd0| 65 64 20 74 68 65 0a 09 | 09 09 53 75 6e 20 52 50 |ed the..|..Sun RP|
|00001fe0| 43 20 63 6f 6d 70 69 6c | 65 72 20 61 6e 64 20 6c |C compil|er and l|
|00001ff0| 69 62 72 61 72 79 2e 0a | 0a 73 65 6c 65 63 74 09 |ibrary..|.select.|
|00002000| 2e 2f 61 73 79 6e 63 69 | 6f 2f 00 00 00 00 00 00 |./asynci|o/......|
|00002010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002060| 00 00 00 00 20 34 30 37 | 35 30 20 00 20 20 20 31 |.... 407|50 . 1|
|00002070| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00002080| 20 20 20 20 20 20 30 20 | 20 35 30 32 35 37 32 36 | 0 | 5025726|
|00002090| 35 32 36 20 20 20 35 37 | 31 32 00 20 00 00 00 00 |526 57|12. ....|
|000020a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002200| 2e 2f 61 73 79 6e 63 69 | 6f 2f 4d 61 6b 65 66 69 |./asynci|o/Makefi|
|00002210| 6c 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |le......|........|
|00002220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002260| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00002270| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00002280| 20 20 20 20 33 36 33 20 | 20 34 35 34 32 37 32 37 | 363 | 4542727|
|00002290| 31 33 36 20 20 20 37 33 | 35 37 00 20 00 00 00 00 |136 73|57. ....|
|000022a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000022f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002400| 23 0a 0a 43 46 4c 41 47 | 53 09 3d 20 2d 4f 0a 4d |#..CFLAG|S.= -O.M|
|00002410| 59 4c 49 42 09 3d 20 2e | 2e 2f 6c 69 62 6e 65 74 |YLIB.= .|./libnet|
|00002420| 2e 61 0a 0a 61 6c 6c 3a | 09 6f 6c 64 63 61 74 20 |.a..all:|.oldcat |
|00002430| 61 69 6f 63 61 74 0a 0a | 23 0a 0a 6f 6c 64 63 61 |aiocat..|#..oldca|
|00002440| 74 3a 09 6f 6c 64 63 61 | 74 2e 6f 20 24 28 4d 59 |t:.oldca|t.o $(MY|
|00002450| 4c 49 42 29 0a 09 63 63 | 20 24 28 43 46 4c 41 47 |LIB)..cc| $(CFLAG|
|00002460| 53 29 20 2d 6f 20 24 40 | 20 6f 6c 64 63 61 74 2e |S) -o $@| oldcat.|
|00002470| 6f 20 24 28 4d 59 4c 49 | 42 29 0a 0a 61 69 6f 63 |o $(MYLI|B)..aioc|
|00002480| 61 74 3a 20 61 69 6f 63 | 61 74 2e 6f 20 24 28 4d |at: aioc|at.o $(M|
|00002490| 59 4c 49 42 29 0a 09 63 | 63 20 24 28 43 46 4c 41 |YLIB)..c|c $(CFLA|
|000024a0| 47 53 29 20 2d 6f 20 24 | 40 20 61 69 6f 63 61 74 |GS) -o $|@ aiocat|
|000024b0| 2e 6f 20 24 28 4d 59 4c | 49 42 29 0a 0a 23 0a 63 |.o $(MYL|IB)..#.c|
|000024c0| 6c 65 61 6e 3a 0a 09 2d | 72 6d 20 2d 66 20 2a 2e |lean:..-|rm -f *.|
|000024d0| 6f 20 63 6f 72 65 20 61 | 2e 6f 75 74 20 74 65 6d |o core a|.out tem|
|000024e0| 70 2a 2e 2a 20 6f 6c 64 | 63 61 74 20 61 69 6f 63 |p*.* old|cat aioc|
|000024f0| 61 74 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |at......|........|
|00002500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002540| 00 00 00 00 00 00 00 00 | 00 00 00 01 00 00 00 0a |........|........|
|00002550| 00 00 00 00 00 00 00 02 | 00 00 00 00 00 00 00 00 |........|........|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 00 00 00 00 00 00 | 00 02 c0 70 00 02 9c 78 |........|...p...x|
|00002580| ff ef e7 ec 00 00 cd 02 | 00 00 21 24 ff ef f4 62 |........|..!$...b|
|00002590| 00 00 00 00 00 00 00 01 | 00 00 21 24 07 0d 03 00 |........|..!$....|
|000025a0| 00 00 b0 3e 41 e8 00 02 | 00 5d 00 70 00 02 6b c8 |...>A...|.].p..k.|
|000025b0| 00 00 04 00 28 60 61 f1 | 00 00 00 00 28 57 ad 56 |....(`a.|....(W.V|
|000025c0| 00 00 00 00 28 5c fe af | 00 00 00 00 00 00 20 00 |....(\..|...... .|
|000025d0| 00 00 00 01 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 01 00 00 ff ef ed 2a | 00 02 9c a1 ff ef e7 ec |.......*|........|
|000025f0| 00 00 ce 1e 00 02 9c a0 | 00 02 9c 7c 00 02 9c 78 |........|...|...x|
|00002600| 2e 2f 61 73 79 6e 63 69 | 6f 2f 6f 6c 64 63 61 74 |./asynci|o/oldcat|
|00002610| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00002620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002660| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00002670| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00002680| 20 20 20 20 34 31 34 20 | 20 34 35 34 32 37 32 37 | 414 | 4542727|
|00002690| 31 33 36 20 20 20 37 33 | 32 36 00 20 00 00 00 00 |136 73|26. ....|
|000026a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002800| 2f 2a 0a 20 2a 20 43 6f | 70 79 20 73 74 61 6e 64 |/*. * Co|py stand|
|00002810| 61 72 64 20 69 6e 70 75 | 74 20 74 6f 20 73 74 61 |ard inpu|t to sta|
|00002820| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 2e 0a 20 2a |ndard ou|tput.. *|
|00002830| 2f 0a 0a 23 64 65 66 69 | 6e 65 09 42 55 46 46 53 |/..#defi|ne.BUFFS|
|00002840| 49 5a 45 09 34 30 39 36 | 0a 0a 6d 61 69 6e 28 29 |IZE.4096|..main()|
|00002850| 0a 7b 0a 09 69 6e 74 09 | 09 6e 3b 0a 09 63 68 61 |.{..int.|.n;..cha|
|00002860| 72 09 09 62 75 66 66 5b | 42 55 46 46 53 49 5a 45 |r..buff[|BUFFSIZE|
|00002870| 5d 3b 0a 0a 09 77 68 69 | 6c 65 20 28 20 28 6e 20 |];...whi|le ( (n |
|00002880| 3d 20 72 65 61 64 28 30 | 2c 20 62 75 66 66 2c 20 |= read(0|, buff, |
|00002890| 42 55 46 46 53 49 5a 45 | 29 29 20 3e 20 30 29 0a |BUFFSIZE|)) > 0).|
|000028a0| 09 09 69 66 20 28 77 72 | 69 74 65 28 31 2c 20 62 |..if (wr|ite(1, b|
|000028b0| 75 66 66 2c 20 6e 29 20 | 21 3d 20 6e 29 0a 09 09 |uff, n) |!= n)...|
|000028c0| 09 65 72 72 5f 73 79 73 | 28 22 77 72 69 74 65 20 |.err_sys|("write |
|000028d0| 65 72 72 6f 72 22 29 3b | 0a 0a 09 69 66 20 28 6e |error");|...if (n|
|000028e0| 20 3c 20 30 29 0a 09 09 | 65 72 72 5f 73 79 73 28 | < 0)...|err_sys(|
|000028f0| 22 72 65 61 64 20 65 72 | 72 6f 72 22 29 3b 0a 0a |"read er|ror");..|
|00002900| 09 65 78 69 74 28 30 29 | 3b 0a 7d 0a 00 00 00 00 |.exit(0)|;.}.....|
|00002910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002940| 00 00 00 00 00 00 00 00 | 00 00 00 01 00 00 00 03 |........|........|
|00002950| 00 00 00 00 00 00 00 02 | 00 00 00 00 00 00 00 00 |........|........|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 00 00 00 00 00 00 | 00 02 c0 70 00 02 9c 78 |........|...p...x|
|00002980| ff ef e7 ec 00 00 cd 02 | 00 00 21 24 00 02 9c 98 |........|..!$....|
|00002990| 00 00 00 00 00 00 00 01 | 00 00 21 24 07 0d 03 00 |........|..!$....|
|000029a0| 00 00 b0 3e 41 e8 00 02 | 00 5d 00 70 00 02 6b c8 |...>A...|.].p..k.|
|000029b0| ff ef ed 2a 00 02 9c a1 | ff ef e7 b8 00 00 ce 1e |...*....|........|
|000029c0| 00 02 9c a0 00 02 9c 98 | 00 02 9c 7c 00 00 20 00 |........|...|.. .|
|000029d0| 00 00 00 01 00 00 6a da | ff ef e7 e8 00 00 6b 00 |......j.|......k.|
|000029e0| 00 02 9c 7c ff ef ed 2a | 00 02 9c a1 ff ef e7 ec |...|...*|........|
|000029f0| 00 00 ce 1e 00 02 9c a0 | 00 02 9c 7c 00 02 9c 78 |........|...|...x|
|00002a00| 2e 2f 61 73 79 6e 63 69 | 6f 2f 61 69 6f 63 61 74 |./asynci|o/aiocat|
|00002a10| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00002a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00002a70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00002a80| 20 20 20 32 30 33 37 20 | 20 34 35 34 32 37 32 37 | 2037 | 4542727|
|00002a90| 32 32 33 20 20 20 37 33 | 34 30 00 20 00 00 00 00 |223 73|40. ....|
|00002aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c00| 2f 2a 0a 20 2a 20 43 6f | 70 79 20 73 74 61 6e 64 |/*. * Co|py stand|
|00002c10| 61 72 64 20 69 6e 70 75 | 74 20 74 6f 20 73 74 61 |ard inpu|t to sta|
|00002c20| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 2c 20 75 73 |ndard ou|tput, us|
|00002c30| 69 6e 67 20 61 73 79 6e | 63 68 72 6f 6e 6f 75 73 |ing asyn|chronous|
|00002c40| 20 49 2f 4f 2e 0a 20 2a | 2f 0a 0a 23 69 6e 63 6c | I/O.. *|/..#incl|
|00002c50| 75 64 65 09 3c 73 69 67 | 6e 61 6c 2e 68 3e 0a 23 |ude.<sig|nal.h>.#|
|00002c60| 69 6e 63 6c 75 64 65 09 | 3c 66 63 6e 74 6c 2e 68 |include.|<fcntl.h|
|00002c70| 3e 0a 0a 23 64 65 66 69 | 6e 65 09 42 55 46 46 53 |>..#defi|ne.BUFFS|
|00002c80| 49 5a 45 09 34 30 39 36 | 0a 0a 69 6e 74 09 73 69 |IZE.4096|..int.si|
|00002c90| 67 66 6c 61 67 3b 0a 0a | 6d 61 69 6e 28 29 0a 7b |gflag;..|main().{|
|00002ca0| 0a 09 69 6e 74 09 09 6e | 3b 0a 09 63 68 61 72 09 |..int..n|;..char.|
|00002cb0| 09 62 75 66 66 5b 42 55 | 46 46 53 49 5a 45 5d 3b |.buff[BU|FFSIZE];|
|00002cc0| 0a 09 69 6e 74 09 09 73 | 69 67 69 6f 5f 66 75 6e |..int..s|igio_fun|
|00002cd0| 63 28 29 3b 0a 0a 09 73 | 69 67 6e 61 6c 28 53 49 |c();...s|ignal(SI|
|00002ce0| 47 49 4f 2c 20 73 69 67 | 69 6f 5f 66 75 6e 63 29 |GIO, sig|io_func)|
|00002cf0| 3b 0a 0a 09 69 66 20 28 | 66 63 6e 74 6c 28 30 2c |;...if (|fcntl(0,|
|00002d00| 20 46 5f 53 45 54 4f 57 | 4e 2c 20 67 65 74 70 69 | F_SETOW|N, getpi|
|00002d10| 64 28 29 29 20 3c 20 30 | 29 0a 09 09 65 72 72 5f |d()) < 0|)...err_|
|00002d20| 73 79 73 28 22 46 5f 53 | 45 54 4f 57 4e 20 65 72 |sys("F_S|ETOWN er|
|00002d30| 72 6f 72 22 29 3b 0a 0a | 09 69 66 20 28 66 63 6e |ror");..|.if (fcn|
|00002d40| 74 6c 28 30 2c 20 46 5f | 53 45 54 46 4c 2c 20 46 |tl(0, F_|SETFL, F|
|00002d50| 41 53 59 4e 43 29 20 3c | 20 30 29 0a 09 09 65 72 |ASYNC) <| 0)...er|
|00002d60| 72 5f 73 79 73 28 22 46 | 5f 53 45 54 46 4c 20 46 |r_sys("F|_SETFL F|
|00002d70| 41 53 59 4e 43 20 65 72 | 72 6f 72 22 29 3b 0a 0a |ASYNC er|ror");..|
|00002d80| 09 66 6f 72 20 28 20 3b | 20 3b 20 29 20 7b 0a 09 |.for ( ;| ; ) {..|
|00002d90| 09 73 69 67 62 6c 6f 63 | 6b 28 73 69 67 6d 61 73 |.sigbloc|k(sigmas|
|00002da0| 6b 28 53 49 47 49 4f 29 | 29 3b 0a 09 09 77 68 69 |k(SIGIO)|);...whi|
|00002db0| 6c 65 20 28 73 69 67 66 | 6c 61 67 20 3d 3d 20 30 |le (sigf|lag == 0|
|00002dc0| 29 0a 09 09 09 73 69 67 | 70 61 75 73 65 28 30 29 |)....sig|pause(0)|
|00002dd0| 3b 09 09 2f 2a 20 77 61 | 69 74 20 66 6f 72 20 61 |;../* wa|it for a|
|00002de0| 20 73 69 67 6e 61 6c 20 | 2a 2f 0a 0a 09 09 2f 2a | signal |*/..../*|
|00002df0| 0a 09 09 20 2a 20 57 65 | 27 72 65 20 68 65 72 65 |... * We|'re here|
|00002e00| 20 69 66 20 28 73 69 67 | 66 6c 61 67 20 21 3d 20 | if (sig|flag != |
|00002e10| 30 29 2e 20 20 41 6c 73 | 6f 2c 20 77 65 20 6b 6e |0). Als|o, we kn|
|00002e20| 6f 77 20 74 68 61 74 20 | 74 68 65 0a 09 09 20 2a |ow that |the... *|
|00002e30| 20 53 49 47 49 4f 20 73 | 69 67 6e 61 6c 20 69 73 | SIGIO s|ignal is|
|00002e40| 20 63 75 72 72 65 6e 74 | 6c 79 20 62 6c 6f 63 6b | current|ly block|
|00002e50| 65 64 2e 0a 09 09 20 2a | 2f 0a 0a 09 09 69 66 20 |ed.... *|/....if |
|00002e60| 28 20 28 6e 20 3d 20 72 | 65 61 64 28 30 2c 20 62 |( (n = r|ead(0, b|
|00002e70| 75 66 66 2c 20 42 55 46 | 46 53 49 5a 45 29 29 20 |uff, BUF|FSIZE)) |
|00002e80| 3e 20 30 29 20 7b 0a 09 | 09 09 69 66 20 28 77 72 |> 0) {..|..if (wr|
|00002e90| 69 74 65 28 31 2c 20 62 | 75 66 66 2c 20 6e 29 20 |ite(1, b|uff, n) |
|00002ea0| 21 3d 20 6e 29 0a 09 09 | 09 09 65 72 72 5f 73 79 |!= n)...|..err_sy|
|00002eb0| 73 28 22 77 72 69 74 65 | 20 65 72 72 6f 72 22 29 |s("write| error")|
|00002ec0| 3b 0a 09 09 7d 20 65 6c | 73 65 20 69 66 20 28 6e |;...} el|se if (n|
|00002ed0| 20 3c 20 30 29 0a 09 09 | 09 65 72 72 5f 73 79 73 | < 0)...|.err_sys|
|00002ee0| 28 22 72 65 61 64 20 65 | 72 72 6f 72 22 29 3b 0a |("read e|rror");.|
|00002ef0| 09 09 65 6c 73 65 20 69 | 66 20 28 6e 20 3d 3d 20 |..else i|f (n == |
|00002f00| 30 29 0a 09 09 09 65 78 | 69 74 28 30 29 3b 09 09 |0)....ex|it(0);..|
|00002f10| 2f 2a 20 45 4f 46 20 2a | 2f 0a 0a 09 09 73 69 67 |/* EOF *|/....sig|
|00002f20| 66 6c 61 67 20 3d 20 30 | 3b 09 09 09 2f 2a 20 74 |flag = 0|;.../* t|
|00002f30| 75 72 6e 20 6f 66 66 20 | 6f 75 72 20 66 6c 61 67 |urn off |our flag|
|00002f40| 20 2a 2f 0a 0a 09 09 73 | 69 67 73 65 74 6d 61 73 | */....s|igsetmas|
|00002f50| 6b 28 30 29 3b 09 09 09 | 2f 2a 20 61 6e 64 20 72 |k(0);...|/* and r|
|00002f60| 65 65 6e 61 62 6c 65 20 | 73 69 67 6e 61 6c 73 20 |eenable |signals |
|00002f70| 2a 2f 0a 09 7d 0a 7d 0a | 0a 69 6e 74 0a 73 69 67 |*/..}.}.|.int.sig|
|00002f80| 69 6f 5f 66 75 6e 63 28 | 29 0a 7b 0a 09 73 69 67 |io_func(|).{..sig|
|00002f90| 66 6c 61 67 20 3d 20 31 | 3b 09 09 2f 2a 20 6a 75 |flag = 1|;../* ju|
|00002fa0| 73 74 20 73 65 74 20 66 | 6c 61 67 20 61 6e 64 20 |st set f|lag and |
|00002fb0| 72 65 74 75 72 6e 20 2a | 2f 0a 0a 09 2f 2a 20 74 |return *|/.../* t|
|00002fc0| 68 65 20 34 2e 33 42 53 | 44 20 73 69 67 6e 61 6c |he 4.3BS|D signal|
|00002fd0| 20 66 61 63 69 6c 69 74 | 69 65 73 20 6c 65 61 76 | facilit|ies leav|
|00002fe0| 65 20 74 68 69 73 20 68 | 61 6e 64 6c 65 72 20 65 |e this h|andler e|
|00002ff0| 6e 61 62 6c 65 64 0a 09 | 20 20 20 66 6f 72 20 61 |nabled..| for a|
|00003000| 6e 79 20 66 75 72 74 68 | 65 72 20 53 49 47 49 4f |ny furth|er SIGIO|
|00003010| 20 73 69 67 6e 61 6c 73 | 2e 20 2a 2f 0a 7d 0a 6e | signals|. */.}.n|
|00003020| 6f 77 20 74 68 61 74 20 | 74 68 65 0a 09 09 20 2a |ow that |the... *|
|00003030| 20 53 49 47 49 4f 20 73 | 69 67 6e 61 6c 20 69 73 | SIGIO s|ignal is|
|00003040| 20 63 75 72 72 65 6e 74 | 6c 79 20 62 6c 6f 63 6b | current|ly block|
|00003050| 65 64 2e 0a 09 09 20 2a | 2f 0a 0a 09 09 69 66 20 |ed.... *|/....if |
|00003060| 28 20 28 6e 20 3d 20 72 | 65 61 64 28 30 2c 20 62 |( (n = r|ead(0, b|
|00003070| 75 66 66 2c 20 42 55 46 | 46 53 49 5a 45 29 29 20 |uff, BUF|FSIZE)) |
|00003080| 3e 20 30 29 20 7b 0a 09 | 09 09 69 66 20 28 77 72 |> 0) {..|..if (wr|
|00003090| 69 74 65 28 31 2c 20 62 | 75 66 66 2c 20 6e 29 20 |ite(1, b|uff, n) |
|000030a0| 21 3d 20 6e 29 0a 09 09 | 09 09 65 72 72 5f 73 79 |!= n)...|..err_sy|
|000030b0| 73 28 22 77 72 69 74 65 | 20 65 72 72 6f 72 22 29 |s("write| error")|
|000030c0| 3b 0a 09 09 7d 20 65 6c | 73 65 20 69 66 20 28 6e |;...} el|se if (n|
|000030d0| 20 3c 20 30 29 0a 09 09 | 09 65 72 72 5f 73 79 73 | < 0)...|.err_sys|
|000030e0| 28 22 72 65 61 64 20 65 | 72 72 6f 72 22 29 3b 0a |("read e|rror");.|
|000030f0| 09 09 65 6c 73 65 20 69 | 66 20 28 6e 20 3d 3d 20 |..else i|f (n == |
|00003100| 30 29 0a 09 09 09 65 78 | 69 74 28 30 29 3b 09 09 |0)....ex|it(0);..|
|00003110| 2f 2a 20 45 4f 46 20 2a | 2f 0a 0a 09 09 73 69 67 |/* EOF *|/....sig|
|00003120| 66 6c 61 67 20 3d 20 30 | 3b 09 09 09 2f 2a 20 74 |flag = 0|;.../* t|
|00003130| 75 72 6e 20 6f 66 66 20 | 6f 75 72 20 66 6c 61 67 |urn off |our flag|
|00003140| 20 2a 2f 0a 0a 09 09 73 | 69 67 73 65 74 6d 61 73 | */....s|igsetmas|
|00003150| 6b 28 30 29 3b 09 09 09 | 2f 2a 20 61 6e 64 20 72 |k(0);...|/* and r|
|00003160| 65 65 6e 61 62 6c 65 20 | 73 69 67 6e 61 6c 73 20 |eenable |signals |
|00003170| 2a 2f 0a 09 7d 0a 7d 0a | 0a 69 6e 74 0a 73 69 67 |*/..}.}.|.int.sig|
|00003180| 69 6f 5f 66 75 6e 63 28 | 29 0a 7b 0a 09 73 69 67 |io_func(|).{..sig|
|00003190| 66 6c 61 67 20 3d 20 31 | 3b 09 09 2f 2a 20 6a 75 |flag = 1|;../* ju|
|000031a0| 73 74 20 73 65 74 20 66 | 6c 61 67 20 61 6e 64 20 |st set f|lag and |
|000031b0| 72 65 74 75 72 6e 20 2a | 2f 0a 0a 09 2f 2a 20 74 |return *|/.../* t|
|000031c0| 68 65 20 34 2e 33 42 53 | 44 20 73 69 67 6e 61 6c |he 4.3BS|D signal|
|000031d0| 20 66 61 63 69 6c 69 74 | 69 65 73 20 6c 65 61 76 | facilit|ies leav|
|000031e0| 65 20 74 68 69 73 20 68 | 61 6e 64 6c 65 72 20 65 |e this h|andler e|
|000031f0| 6e 61 62 6c 65 64 0a 09 | 20 20 20 66 6f 72 20 61 |nabled..| for a|
|00003200| 2e 2f 66 64 2e 73 35 2f | 00 00 00 00 00 00 00 00 |./fd.s5/|........|
|00003210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 00 00 20 34 30 37 | 35 30 20 00 20 20 20 31 |.... 407|50 . 1|
|00003270| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00003280| 20 20 20 20 20 20 30 20 | 20 35 30 32 35 37 32 36 | 0 | 5025726|
|00003290| 35 33 37 20 20 20 35 31 | 36 36 00 20 00 00 00 00 |537 51|66. ....|
|000032a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003400| 2e 2f 66 64 2e 73 35 2f | 4d 61 6b 65 66 69 6c 65 |./fd.s5/|Makefile|
|00003410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003460| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00003470| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00003480| 20 20 20 31 30 36 36 20 | 20 34 35 34 32 37 32 37 | 1066 | 4542727|
|00003490| 31 33 36 20 20 20 36 36 | 35 32 00 20 00 00 00 00 |136 66|52. ....|
|000034a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003600| 23 0a 23 20 4d 61 6b 65 | 66 69 6c 65 20 66 6f 72 |#.# Make|file for|
|00003610| 20 66 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 | file de|scriptor|
|00003620| 20 70 61 73 73 69 6e 67 | 20 65 78 61 6d 70 6c 65 | passing| example|
|00003630| 2e 20 20 4e 6f 74 65 20 | 74 68 61 74 20 74 68 65 |. Note |that the|
|00003640| 20 73 61 6d 65 20 4d 61 | 6b 65 66 69 6c 65 0a 23 | same Ma|kefile.#|
|00003650| 20 63 61 6e 20 62 65 20 | 75 73 65 64 20 66 6f 72 | can be |used for|
|00003660| 20 62 6f 74 68 20 34 2e | 33 42 53 44 20 61 6e 64 | both 4.|3BSD and|
|00003670| 20 53 79 73 74 65 6d 20 | 56 2e 20 20 54 68 65 20 | System |V. The |
|00003680| 6f 6e 6c 79 20 64 69 66 | 66 65 72 65 6e 63 65 73 |only dif|ferences|
|00003690| 20 69 6e 20 74 68 65 0a | 23 20 74 77 6f 20 65 78 | in the.|# two ex|
|000036a0| 61 6d 70 6c 65 73 20 61 | 72 65 20 74 68 65 20 66 |amples a|re the f|
|000036b0| 69 6c 65 73 20 22 73 65 | 6e 64 66 69 6c 65 2e 63 |iles "se|ndfile.c|
|000036c0| 22 20 61 6e 64 20 22 72 | 65 63 76 66 69 6c 65 2e |" and "r|ecvfile.|
|000036d0| 63 22 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 74 68 |c" along| with th|
|000036e0| 65 0a 23 20 64 69 66 66 | 65 72 65 6e 74 20 4d 59 |e.# diff|erent MY|
|000036f0| 4c 49 42 20 63 6f 6e 74 | 65 6e 74 73 2e 0a 23 0a |LIB cont|ents..#.|
|00003700| 0a 43 46 4c 41 47 53 09 | 3d 20 2d 4f 0a 4d 59 4c |.CFLAGS.|= -O.MYL|
|00003710| 49 42 09 3d 20 2e 2e 2f | 6c 69 62 6e 65 74 2e 61 |IB.= ../|libnet.a|
|00003720| 0a 0a 61 6c 6c 3a 09 6d | 79 63 61 74 20 6f 70 65 |..all:.m|ycat ope|
|00003730| 6e 66 69 6c 65 0a 0a 23 | 0a 0a 6d 79 63 61 74 3a |nfile..#|..mycat:|
|00003740| 09 6d 79 63 61 74 2e 6f | 20 6d 79 6f 70 65 6e 2e |.mycat.o| myopen.|
|00003750| 6f 20 72 65 63 76 66 69 | 6c 65 2e 6f 20 24 28 4d |o recvfi|le.o $(M|
|00003760| 59 4c 49 42 29 0a 09 63 | 63 20 24 28 43 46 4c 41 |YLIB)..c|c $(CFLA|
|00003770| 47 53 29 20 2d 6f 20 24 | 40 20 6d 79 63 61 74 2e |GS) -o $|@ mycat.|
|00003780| 6f 20 6d 79 6f 70 65 6e | 2e 6f 20 72 65 63 76 66 |o myopen|.o recvf|
|00003790| 69 6c 65 2e 6f 20 24 28 | 4d 59 4c 49 42 29 0a 0a |ile.o $(|MYLIB)..|
|000037a0| 6f 70 65 6e 66 69 6c 65 | 3a 20 6f 70 65 6e 66 69 |openfile|: openfi|
|000037b0| 6c 65 2e 6f 20 73 65 6e | 64 66 69 6c 65 2e 6f 20 |le.o sen|dfile.o |
|000037c0| 24 28 4d 59 4c 49 42 29 | 0a 09 20 20 63 63 20 24 |$(MYLIB)|.. cc $|
|000037d0| 28 43 46 4c 41 47 53 29 | 20 2d 6f 20 24 40 20 6f |(CFLAGS)| -o $@ o|
|000037e0| 70 65 6e 66 69 6c 65 2e | 6f 20 73 65 6e 64 66 69 |penfile.|o sendfi|
|000037f0| 6c 65 2e 6f 20 24 28 4d | 59 4c 49 42 29 0a 0a 23 |le.o $(M|YLIB)..#|
|00003800| 0a 63 6c 65 61 6e 3a 0a | 09 2d 72 6d 20 2d 66 20 |.clean:.|.-rm -f |
|00003810| 2a 2e 6f 20 63 6f 72 65 | 20 61 2e 6f 75 74 20 74 |*.o core| a.out t|
|00003820| 65 6d 70 2a 2e 2a 20 6d | 79 63 61 74 20 6f 70 65 |emp*.* m|ycat ope|
|00003830| 6e 66 69 6c 65 0a 65 20 | 74 68 61 74 20 74 68 65 |nfile.e |that the|
|00003840| 20 73 61 6d 65 20 4d 61 | 6b 65 66 69 6c 65 0a 23 | same Ma|kefile.#|
|00003850| 20 63 61 6e 20 62 65 20 | 75 73 65 64 20 66 6f 72 | can be |used for|
|00003860| 20 62 6f 74 68 20 34 2e | 33 42 53 44 20 61 6e 64 | both 4.|3BSD and|
|00003870| 20 53 79 73 74 65 6d 20 | 56 2e 20 20 54 68 65 20 | System |V. The |
|00003880| 6f 6e 6c 79 20 64 69 66 | 66 65 72 65 6e 63 65 73 |only dif|ferences|
|00003890| 20 69 6e 20 74 68 65 0a | 23 20 74 77 6f 20 65 78 | in the.|# two ex|
|000038a0| 61 6d 70 6c 65 73 20 61 | 72 65 20 74 68 65 20 66 |amples a|re the f|
|000038b0| 69 6c 65 73 20 22 73 65 | 6e 64 66 69 6c 65 2e 63 |iles "se|ndfile.c|
|000038c0| 22 20 61 6e 64 20 22 72 | 65 63 76 66 69 6c 65 2e |" and "r|ecvfile.|
|000038d0| 63 22 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 74 68 |c" along| with th|
|000038e0| 65 0a 23 20 64 69 66 66 | 65 72 65 6e 74 20 4d 59 |e.# diff|erent MY|
|000038f0| 4c 49 42 20 63 6f 6e 74 | 65 6e 74 73 2e 0a 23 0a |LIB cont|ents..#.|
|00003900| 0a 43 46 4c 41 47 53 09 | 3d 20 2d 4f 0a 4d 59 4c |.CFLAGS.|= -O.MYL|
|00003910| 49 42 09 3d 20 2e 2e 2f | 6c 69 62 6e 65 74 2e 61 |IB.= ../|libnet.a|
|00003920| 0a 0a 61 6c 6c 3a 09 6d | 79 63 61 74 20 6f 70 65 |..all:.m|ycat ope|
|00003930| 6e 66 69 6c 65 0a 0a 23 | 0a 0a 6d 79 63 61 74 3a |nfile..#|..mycat:|
|00003940| 09 6d 79 63 61 74 2e 6f | 20 6d 79 6f 70 65 6e 2e |.mycat.o| myopen.|
|00003950| 6f 20 72 65 63 76 66 69 | 6c 65 2e 6f 20 24 28 4d |o recvfi|le.o $(M|
|00003960| 59 4c 49 42 29 0a 09 63 | 63 20 24 28 43 46 4c 41 |YLIB)..c|c $(CFLA|
|00003970| 47 53 29 20 2d 6f 20 24 | 40 20 6d 79 63 61 74 2e |GS) -o $|@ mycat.|
|00003980| 6f 20 6d 79 6f 70 65 6e | 2e 6f 20 72 65 63 76 66 |o myopen|.o recvf|
|00003990| 69 6c 65 2e 6f 20 24 28 | 4d 59 4c 49 42 29 0a 0a |ile.o $(|MYLIB)..|
|000039a0| 6f 70 65 6e 66 69 6c 65 | 3a 20 6f 70 65 6e 66 69 |openfile|: openfi|
|000039b0| 6c 65 2e 6f 20 73 65 6e | 64 66 69 6c 65 2e 6f 20 |le.o sen|dfile.o |
|000039c0| 24 28 4d 59 4c 49 42 29 | 0a 09 20 20 63 63 20 24 |$(MYLIB)|.. cc $|
|000039d0| 28 43 46 4c 41 47 53 29 | 20 2d 6f 20 24 40 20 6f |(CFLAGS)| -o $@ o|
|000039e0| 70 65 6e 66 69 6c 65 2e | 6f 20 73 65 6e 64 66 69 |penfile.|o sendfi|
|000039f0| 6c 65 2e 6f 20 24 28 4d | 59 4c 49 42 29 0a 0a 23 |le.o $(M|YLIB)..#|
|00003a00| 2e 2f 66 64 2e 73 35 2f | 6d 79 63 61 74 2e 63 00 |./fd.s5/|mycat.c.|
|00003a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00003a70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00003a80| 20 20 20 31 31 36 35 20 | 20 34 35 34 32 37 32 37 | 1165 | 4542727|
|00003a90| 31 33 36 20 20 20 36 34 | 37 33 00 20 00 00 00 00 |136 64|73. ....|
|00003aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c00| 2f 2a 0a 20 2a 20 43 61 | 74 65 6e 61 74 65 20 6f |/*. * Ca|tenate o|
|00003c10| 6e 65 20 6f 72 20 6d 6f | 72 65 20 66 69 6c 65 73 |ne or mo|re files|
|00003c20| 20 74 6f 20 73 74 61 6e | 64 61 72 64 20 6f 75 74 | to stan|dard out|
|00003c30| 70 75 74 2e 0a 20 2a 20 | 49 66 20 6e 6f 20 66 69 |put.. * |If no fi|
|00003c40| 6c 65 73 20 61 72 65 20 | 73 70 65 63 69 66 69 65 |les are |specifie|
|00003c50| 64 2c 20 64 65 66 61 75 | 6c 74 20 74 6f 20 73 74 |d, defau|lt to st|
|00003c60| 61 6e 64 61 72 64 20 69 | 6e 70 75 74 2e 0a 20 2a |andard i|nput.. *|
|00003c70| 2f 0a 0a 23 64 65 66 69 | 6e 65 09 42 55 46 46 53 |/..#defi|ne.BUFFS|
|00003c80| 49 5a 45 09 34 30 39 36 | 0a 0a 6d 61 69 6e 28 61 |IZE.4096|..main(a|
|00003c90| 72 67 63 2c 20 61 72 67 | 76 29 0a 69 6e 74 09 61 |rgc, arg|v).int.a|
|00003ca0| 72 67 63 3b 0a 63 68 61 | 72 09 2a 61 72 67 76 5b |rgc;.cha|r.*argv[|
|00003cb0| 5d 3b 0a 7b 0a 09 69 6e | 74 09 09 66 64 2c 20 69 |];.{..in|t..fd, i|
|00003cc0| 2c 20 6e 3b 0a 09 63 68 | 61 72 09 09 62 75 66 66 |, n;..ch|ar..buff|
|00003cd0| 5b 42 55 46 46 53 49 5a | 45 5d 3b 0a 09 65 78 74 |[BUFFSIZ|E];..ext|
|00003ce0| 65 72 6e 20 63 68 61 72 | 09 2a 70 6e 61 6d 65 3b |ern char|.*pname;|
|00003cf0| 0a 0a 09 70 6e 61 6d 65 | 20 3d 20 61 72 67 76 5b |...pname| = argv[|
|00003d00| 30 5d 3b 0a 09 61 72 67 | 76 2b 2b 3b 20 61 72 67 |0];..arg|v++; arg|
|00003d10| 63 2d 2d 3b 0a 0a 09 66 | 64 20 3d 20 30 3b 09 09 |c--;...f|d = 0;..|
|00003d20| 2f 2a 20 64 65 66 61 75 | 6c 74 20 74 6f 20 73 74 |/* defau|lt to st|
|00003d30| 64 69 6e 20 69 66 20 6e | 6f 20 61 72 67 75 6d 65 |din if n|o argume|
|00003d40| 6e 74 73 20 2a 2f 0a 09 | 69 20 3d 20 30 3b 0a 09 |nts */..|i = 0;..|
|00003d50| 64 6f 20 7b 0a 09 09 69 | 66 20 28 61 72 67 63 20 |do {...i|f (argc |
|00003d60| 3e 20 30 20 26 26 20 28 | 66 64 20 3d 20 6d 79 5f |> 0 && (|fd = my_|
|00003d70| 6f 70 65 6e 28 61 72 67 | 76 5b 69 5d 2c 20 30 29 |open(arg|v[i], 0)|
|00003d80| 29 20 3c 20 30 29 20 7b | 0a 09 09 09 65 72 72 5f |) < 0) {|....err_|
|00003d90| 72 65 74 28 22 63 61 6e | 27 74 20 6f 70 65 6e 20 |ret("can|'t open |
|00003da0| 25 73 22 2c 20 61 72 67 | 76 5b 69 5d 29 3b 0a 09 |%s", arg|v[i]);..|
|00003db0| 09 09 63 6f 6e 74 69 6e | 75 65 3b 0a 09 09 7d 0a |..contin|ue;...}.|
|00003dc0| 0a 09 09 77 68 69 6c 65 | 20 28 20 28 6e 20 3d 20 |...while| ( (n = |
|00003dd0| 72 65 61 64 28 66 64 2c | 20 62 75 66 66 2c 20 42 |read(fd,| buff, B|
|00003de0| 55 46 46 53 49 5a 45 29 | 29 20 3e 20 30 29 0a 09 |UFFSIZE)|) > 0)..|
|00003df0| 09 09 69 66 20 28 77 72 | 69 74 65 28 31 2c 20 62 |..if (wr|ite(1, b|
|00003e00| 75 66 66 2c 20 6e 29 20 | 21 3d 20 6e 29 0a 09 09 |uff, n) |!= n)...|
|00003e10| 09 09 65 72 72 5f 73 79 | 73 28 22 77 72 69 74 65 |..err_sy|s("write|
|00003e20| 20 65 72 72 6f 72 22 29 | 3b 0a 09 09 69 66 20 28 | error")|;...if (|
|00003e30| 6e 20 3c 20 30 29 0a 09 | 09 09 65 72 72 5f 73 79 |n < 0)..|..err_sy|
|00003e40| 73 28 22 72 65 61 64 20 | 65 72 72 6f 72 22 29 3b |s("read |error");|
|00003e50| 0a 0a 09 7d 20 77 68 69 | 6c 65 20 28 2b 2b 69 20 |...} whi|le (++i |
|00003e60| 3c 20 61 72 67 63 29 3b | 0a 09 65 78 69 74 28 30 |< argc);|..exit(0|
|00003e70| 29 3b 0a 7d 0a 65 66 69 | 6e 65 09 42 55 46 46 53 |);.}.efi|ne.BUFFS|
|00003e80| 49 5a 45 09 34 30 39 36 | 0a 0a 6d 61 69 6e 28 61 |IZE.4096|..main(a|
|00003e90| 72 67 63 2c 20 61 72 67 | 76 29 0a 69 6e 74 09 61 |rgc, arg|v).int.a|
|00003ea0| 72 67 63 3b 0a 63 68 61 | 72 09 2a 61 72 67 76 5b |rgc;.cha|r.*argv[|
|00003eb0| 5d 3b 0a 7b 0a 09 69 6e | 74 09 09 66 64 2c 20 69 |];.{..in|t..fd, i|
|00003ec0| 2c 20 6e 3b 0a 09 63 68 | 61 72 09 09 62 75 66 66 |, n;..ch|ar..buff|
|00003ed0| 5b 42 55 46 46 53 49 5a | 45 5d 3b 0a 09 65 78 74 |[BUFFSIZ|E];..ext|
|00003ee0| 65 72 6e 20 63 68 61 72 | 09 2a 70 6e 61 6d 65 3b |ern char|.*pname;|
|00003ef0| 0a 0a 09 70 6e 61 6d 65 | 20 3d 20 61 72 67 76 5b |...pname| = argv[|
|00003f00| 30 5d 3b 0a 09 61 72 67 | 76 2b 2b 3b 20 61 72 67 |0];..arg|v++; arg|
|00003f10| 63 2d 2d 3b 0a 0a 09 66 | 64 20 3d 20 30 3b 09 09 |c--;...f|d = 0;..|
|00003f20| 2f 2a 20 64 65 66 61 75 | 6c 74 20 74 6f 20 73 74 |/* defau|lt to st|
|00003f30| 64 69 6e 20 69 66 20 6e | 6f 20 61 72 67 75 6d 65 |din if n|o argume|
|00003f40| 6e 74 73 20 2a 2f 0a 09 | 69 20 3d 20 30 3b 0a 09 |nts */..|i = 0;..|
|00003f50| 64 6f 20 7b 0a 09 09 69 | 66 20 28 61 72 67 63 20 |do {...i|f (argc |
|00003f60| 3e 20 30 20 26 26 20 28 | 66 64 20 3d 20 6d 79 5f |> 0 && (|fd = my_|
|00003f70| 6f 70 65 6e 28 61 72 67 | 76 5b 69 5d 2c 20 30 29 |open(arg|v[i], 0)|
|00003f80| 29 20 3c 20 30 29 20 7b | 0a 09 09 09 65 72 72 5f |) < 0) {|....err_|
|00003f90| 72 65 74 28 22 63 61 6e | 27 74 20 6f 70 65 6e 20 |ret("can|'t open |
|00003fa0| 25 73 22 2c 20 61 72 67 | 76 5b 69 5d 29 3b 0a 09 |%s", arg|v[i]);..|
|00003fb0| 09 09 63 6f 6e 74 69 6e | 75 65 3b 0a 09 09 7d 0a |..contin|ue;...}.|
|00003fc0| 0a 09 09 77 68 69 6c 65 | 20 28 20 28 6e 20 3d 20 |...while| ( (n = |
|00003fd0| 72 65 61 64 28 66 64 2c | 20 62 75 66 66 2c 20 42 |read(fd,| buff, B|
|00003fe0| 55 46 46 53 49 5a 45 29 | 29 20 3e 20 30 29 0a 09 |UFFSIZE)|) > 0)..|
|00003ff0| 09 09 69 66 20 28 77 72 | 69 74 65 28 31 2c 20 62 |..if (wr|ite(1, b|
|00004000| 2e 2f 66 64 2e 73 35 2f | 6d 79 6f 70 65 6e 2e 63 |./fd.s5/|myopen.c|
|00004010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004060| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00004070| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00004080| 20 20 20 32 35 30 35 20 | 20 34 35 34 32 37 32 37 | 2505 | 4542727|
|00004090| 32 32 35 20 20 20 36 36 | 36 33 00 20 00 00 00 00 |225 66|63. ....|
|000040a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004200| 2f 2a 0a 20 2a 20 4f 70 | 65 6e 20 61 20 66 69 6c |/*. * Op|en a fil|
|00004210| 65 2c 20 72 65 74 75 72 | 6e 69 6e 67 20 61 20 66 |e, retur|ning a f|
|00004220| 69 6c 65 20 64 65 73 63 | 72 69 70 74 6f 72 2e 0a |ile desc|riptor..|
|00004230| 20 2a 0a 20 2a 20 54 68 | 69 73 20 66 75 6e 63 74 | *. * Th|is funct|
|00004240| 69 6f 6e 20 69 73 20 73 | 69 6d 69 6c 61 72 20 74 |ion is s|imilar t|
|00004250| 6f 20 74 68 65 20 55 4e | 49 58 20 6f 70 65 6e 28 |o the UN|IX open(|
|00004260| 29 20 73 79 73 74 65 6d | 20 63 61 6c 6c 2c 0a 20 |) system| call,. |
|00004270| 2a 20 68 6f 77 65 76 65 | 72 20 68 65 72 65 20 77 |* howeve|r here w|
|00004280| 65 20 69 6e 76 6f 6b 65 | 20 61 6e 6f 74 68 65 72 |e invoke| another|
|00004290| 20 70 72 6f 67 72 61 6d | 20 74 6f 20 64 6f 20 74 | program| to do t|
|000042a0| 68 65 20 61 63 74 75 61 | 6c 0a 20 2a 20 6f 70 65 |he actua|l. * ope|
|000042b0| 6e 28 29 2c 20 74 6f 20 | 69 6c 6c 75 73 74 72 61 |n(), to |illustra|
|000042c0| 74 65 20 74 68 65 20 70 | 61 73 73 69 6e 67 20 6f |te the p|assing o|
|000042d0| 66 20 6f 70 65 6e 20 66 | 69 6c 65 73 0a 20 2a 20 |f open f|iles. * |
|000042e0| 62 65 74 77 65 65 6e 20 | 70 72 6f 63 65 73 73 65 |between |processe|
|000042f0| 73 2e 0a 20 2a 2f 0a 0a | 69 6e 74 0a 6d 79 5f 6f |s.. */..|int.my_o|
|00004300| 70 65 6e 28 66 69 6c 65 | 6e 61 6d 65 2c 20 6d 6f |pen(file|name, mo|
|00004310| 64 65 29 0a 63 68 61 72 | 09 2a 66 69 6c 65 6e 61 |de).char|.*filena|
|00004320| 6d 65 3b 0a 69 6e 74 09 | 6d 6f 64 65 3b 0a 7b 0a |me;.int.|mode;.{.|
|00004330| 09 69 6e 74 09 09 66 64 | 2c 20 63 68 69 6c 64 70 |.int..fd|, childp|
|00004340| 69 64 2c 20 73 66 64 5b | 32 5d 2c 20 73 74 61 74 |id, sfd[|2], stat|
|00004350| 75 73 3b 0a 09 63 68 61 | 72 09 09 61 72 67 73 66 |us;..cha|r..argsf|
|00004360| 64 5b 31 30 5d 2c 20 61 | 72 67 6d 6f 64 65 5b 31 |d[10], a|rgmode[1|
|00004370| 30 5d 3b 0a 09 65 78 74 | 65 72 6e 20 69 6e 74 09 |0];..ext|ern int.|
|00004380| 65 72 72 6e 6f 3b 0a 0a | 09 69 66 20 28 73 5f 70 |errno;..|.if (s_p|
|00004390| 69 70 65 28 73 66 64 29 | 20 3c 20 30 29 09 09 2f |ipe(sfd)| < 0)../|
|000043a0| 2a 20 63 72 65 61 74 65 | 20 61 6e 20 75 6e 6e 61 |* create| an unna|
|000043b0| 6d 65 64 20 73 74 72 65 | 61 6d 20 70 69 70 65 20 |med stre|am pipe |
|000043c0| 2a 2f 0a 09 09 72 65 74 | 75 72 6e 28 2d 31 29 3b |*/...ret|urn(-1);|
|000043d0| 09 09 2f 2a 20 65 72 72 | 6e 6f 20 77 69 6c 6c 20 |../* err|no will |
|000043e0| 62 65 20 73 65 74 20 2a | 2f 0a 0a 09 69 66 20 28 |be set *|/...if (|
|000043f0| 20 28 63 68 69 6c 64 70 | 69 64 20 3d 20 66 6f 72 | (childp|id = for|
|00004400| 6b 28 29 29 20 3c 20 30 | 29 0a 09 09 65 72 72 5f |k()) < 0|)...err_|
|00004410| 73 79 73 28 22 63 61 6e | 27 74 20 66 6f 72 6b 22 |sys("can|'t fork"|
|00004420| 29 3b 0a 0a 09 65 6c 73 | 65 20 69 66 20 28 63 68 |);...els|e if (ch|
|00004430| 69 6c 64 70 69 64 20 3d | 3d 20 30 29 20 7b 09 2f |ildpid =|= 0) {./|
|00004440| 2a 20 63 68 69 6c 64 20 | 70 72 6f 63 65 73 73 20 |* child |process |
|00004450| 2a 2f 0a 09 09 63 6c 6f | 73 65 28 73 66 64 5b 30 |*/...clo|se(sfd[0|
|00004460| 5d 29 3b 09 09 2f 2a 20 | 63 6c 6f 73 65 20 74 68 |]);../* |close th|
|00004470| 65 20 65 6e 64 20 77 65 | 20 64 6f 6e 27 74 20 75 |e end we| don't u|
|00004480| 73 65 20 2a 2f 0a 09 09 | 73 70 72 69 6e 74 66 28 |se */...|sprintf(|
|00004490| 61 72 67 73 66 64 2c 20 | 22 25 64 22 2c 20 73 66 |argsfd, |"%d", sf|
|000044a0| 64 5b 31 5d 29 3b 0a 09 | 09 73 70 72 69 6e 74 66 |d[1]);..|.sprintf|
|000044b0| 28 61 72 67 6d 6f 64 65 | 2c 20 22 25 64 22 2c 20 |(argmode|, "%d", |
|000044c0| 6d 6f 64 65 29 3b 0a 09 | 09 69 66 20 28 65 78 65 |mode);..|.if (exe|
|000044d0| 63 6c 28 22 2e 2f 6f 70 | 65 6e 66 69 6c 65 22 2c |cl("./op|enfile",|
|000044e0| 20 22 6f 70 65 6e 66 69 | 6c 65 22 2c 20 61 72 67 | "openfi|le", arg|
|000044f0| 73 66 64 2c 20 66 69 6c | 65 6e 61 6d 65 2c 0a 09 |sfd, fil|ename,..|
|00004500| 09 09 20 20 61 72 67 6d | 6f 64 65 2c 20 28 63 68 |.. argm|ode, (ch|
|00004510| 61 72 20 2a 29 20 30 29 | 20 3c 20 30 29 0a 09 09 |ar *) 0)| < 0)...|
|00004520| 09 09 65 72 72 5f 73 79 | 73 28 22 63 61 6e 27 74 |..err_sy|s("can't|
|00004530| 20 65 78 65 63 6c 22 29 | 3b 0a 09 7d 0a 0a 09 2f | execl")|;..}.../|
|00004540| 2a 20 70 61 72 65 6e 74 | 20 70 72 6f 63 65 73 73 |* parent| process|
|00004550| 20 2d 20 77 61 69 74 20 | 66 6f 72 20 74 68 65 20 | - wait |for the |
|00004560| 63 68 69 6c 64 27 73 20 | 65 78 65 63 6c 28 29 20 |child's |execl() |
|00004570| 74 6f 20 63 6f 6d 70 6c | 65 74 65 20 2a 2f 0a 0a |to compl|ete */..|
|00004580| 09 63 6c 6f 73 65 28 73 | 66 64 5b 31 5d 29 3b 09 |.close(s|fd[1]);.|
|00004590| 09 09 2f 2a 20 63 6c 6f | 73 65 20 74 68 65 20 65 |../* clo|se the e|
|000045a0| 6e 64 20 77 65 20 64 6f | 6e 27 74 20 75 73 65 20 |nd we do|n't use |
|000045b0| 2a 2f 0a 09 69 66 20 28 | 77 61 69 74 28 26 73 74 |*/..if (|wait(&st|
|000045c0| 61 74 75 73 29 20 21 3d | 20 63 68 69 6c 64 70 69 |atus) !=| childpi|
|000045d0| 64 29 0a 09 09 65 72 72 | 5f 64 75 6d 70 28 22 77 |d)...err|_dump("w|
|000045e0| 61 69 74 20 65 72 72 6f | 72 22 29 3b 0a 09 69 66 |ait erro|r");..if|
|000045f0| 20 28 28 73 74 61 74 75 | 73 20 26 20 32 35 35 29 | ((statu|s & 255)|
|00004600| 20 21 3d 20 30 29 0a 09 | 09 65 72 72 5f 64 75 6d | != 0)..|.err_dum|
|00004610| 70 28 22 63 68 69 6c 64 | 20 64 69 64 20 6e 6f 74 |p("child| did not|
|00004620| 20 65 78 69 74 22 29 3b | 0a 09 73 74 61 74 75 73 | exit");|..status|
|00004630| 20 3d 20 28 73 74 61 74 | 75 73 20 3e 3e 20 38 29 | = (stat|us >> 8)|
|00004640| 20 26 20 32 35 35 3b 09 | 09 2f 2a 20 63 68 69 6c | & 255;.|./* chil|
|00004650| 64 27 73 20 65 78 69 74 | 28 29 20 61 72 67 75 6d |d's exit|() argum|
|00004660| 65 6e 74 20 2a 2f 0a 09 | 69 66 20 28 73 74 61 74 |ent */..|if (stat|
|00004670| 75 73 20 3d 3d 20 30 29 | 20 7b 0a 09 09 66 64 20 |us == 0)| {...fd |
|00004680| 3d 20 72 65 63 76 66 69 | 6c 65 28 73 66 64 5b 30 |= recvfi|le(sfd[0|
|00004690| 5d 29 3b 09 09 2f 2a 20 | 61 6c 6c 20 4f 4b 2c 20 |]);../* |all OK, |
|000046a0| 72 65 63 65 69 76 65 20 | 66 64 20 2a 2f 0a 09 7d |receive |fd */..}|
|000046b0| 20 65 6c 73 65 20 7b 0a | 09 09 65 72 72 6e 6f 20 | else {.|..errno |
|000046c0| 3d 20 73 74 61 74 75 73 | 3b 09 2f 2a 20 65 72 72 |= status|;./* err|
|000046d0| 6f 72 2c 20 73 65 74 20 | 65 72 72 6e 6f 20 76 61 |or, set |errno va|
|000046e0| 6c 75 65 20 66 72 6f 6d | 20 63 68 69 6c 64 27 73 |lue from| child's|
|000046f0| 20 65 72 72 6e 6f 20 2a | 2f 0a 09 09 66 64 20 3d | errno *|/...fd =|
|00004700| 20 2d 31 3b 0a 09 7d 0a | 0a 09 63 6c 6f 73 65 28 | -1;..}.|..close(|
|00004710| 73 66 64 5b 30 5d 29 3b | 09 09 2f 2a 20 63 6c 6f |sfd[0]);|../* clo|
|00004720| 73 65 20 74 68 65 20 73 | 74 72 65 61 6d 20 70 69 |se the s|tream pi|
|00004730| 70 65 20 2a 2f 0a 09 72 | 65 74 75 72 6e 28 66 64 |pe */..r|eturn(fd|
|00004740| 29 3b 0a 7d 0a 65 6e 74 | 20 70 72 6f 63 65 73 73 |);.}.ent| process|
|00004750| 20 2d 20 77 61 69 74 20 | 66 6f 72 20 74 68 65 20 | - wait |for the |
|00004760| 63 68 69 6c 64 27 73 20 | 65 78 65 63 6c 28 29 20 |child's |execl() |
|00004770| 74 6f 20 63 6f 6d 70 6c | 65 74 65 20 2a 2f 0a 0a |to compl|ete */..|
|00004780| 09 63 6c 6f 73 65 28 73 | 66 64 5b 31 5d 29 3b 09 |.close(s|fd[1]);.|
|00004790| 09 09 2f 2a 20 63 6c 6f | 73 65 20 74 68 65 20 65 |../* clo|se the e|
|000047a0| 6e 64 20 77 65 20 64 6f | 6e 27 74 20 75 73 65 20 |nd we do|n't use |
|000047b0| 2a 2f 0a 09 69 66 20 28 | 77 61 69 74 28 26 73 74 |*/..if (|wait(&st|
|000047c0| 61 74 75 73 29 20 21 3d | 20 63 68 69 6c 64 70 69 |atus) !=| childpi|
|000047d0| 64 29 0a 09 09 65 72 72 | 5f 64 75 6d 70 28 22 77 |d)...err|_dump("w|
|000047e0| 61 69 74 20 65 72 72 6f | 72 22 29 3b 0a 09 69 66 |ait erro|r");..if|
|000047f0| 20 28 28 73 74 61 74 75 | 73 20 26 20 32 35 35 29 | ((statu|s & 255)|
|00004800| 2e 2f 66 64 2e 73 35 2f | 6f 70 65 6e 66 69 6c 65 |./fd.s5/|openfile|
|00004810| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00004870| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00004880| 20 20 20 31 33 35 34 20 | 20 34 35 34 32 37 32 37 | 1354 | 4542727|
|00004890| 31 33 37 20 20 20 37 31 | 36 30 00 20 00 00 00 00 |137 71|60. ....|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 2f 2a 0a 20 2a 09 6f 70 | 65 6e 66 69 6c 65 20 20 |/*. *.op|enfile |
|00004a10| 3c 73 6f 63 6b 65 74 2d | 64 65 73 63 72 69 70 74 |<socket-|descript|
|00004a20| 6f 72 2d 6e 75 6d 62 65 | 72 3e 20 20 3c 66 69 6c |or-numbe|r> <fil|
|00004a30| 65 6e 61 6d 65 3e 20 20 | 3c 6d 6f 64 65 3e 0a 20 |ename> |<mode>. |
|00004a40| 2a 0a 20 2a 20 4f 70 65 | 6e 20 74 68 65 20 73 70 |*. * Ope|n the sp|
|00004a50| 65 63 69 66 69 65 64 20 | 66 69 6c 65 20 75 73 69 |ecified |file usi|
|00004a60| 6e 67 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |ng the s|pecified|
|00004a70| 20 6d 6f 64 65 2e 0a 20 | 2a 20 52 65 74 75 72 6e | mode.. |* Return|
|00004a80| 20 74 68 65 20 6f 70 65 | 6e 20 66 69 6c 65 20 64 | the ope|n file d|
|00004a90| 65 73 63 72 69 70 74 6f | 72 20 6f 6e 20 74 68 65 |escripto|r on the|
|00004aa0| 20 73 70 65 63 69 66 69 | 65 64 20 73 6f 63 6b 65 | specifi|ed socke|
|00004ab0| 74 20 64 65 73 63 72 69 | 70 74 6f 72 0a 20 2a 20 |t descri|ptor. * |
|00004ac0| 28 77 68 69 63 68 20 74 | 68 65 20 69 6e 76 6f 6b |(which t|he invok|
|00004ad0| 65 72 20 68 61 73 20 74 | 6f 20 73 65 74 20 75 70 |er has t|o set up|
|00004ae0| 20 62 65 66 6f 72 65 20 | 65 78 65 63 27 69 6e 67 | before |exec'ing|
|00004af0| 20 75 73 29 2e 0a 20 2a | 20 57 65 20 65 78 69 74 | us).. *| We exit|
|00004b00| 28 29 20 77 69 74 68 20 | 61 20 76 61 6c 75 65 20 |() with |a value |
|00004b10| 6f 66 20 30 20 69 66 20 | 61 6c 6c 20 69 73 20 4f |of 0 if |all is O|
|00004b20| 4b 2c 20 6f 74 68 65 72 | 77 69 73 65 20 77 65 20 |K, other|wise we |
|00004b30| 70 61 73 73 20 62 61 63 | 6b 20 74 68 65 0a 20 2a |pass bac|k the. *|
|00004b40| 20 65 72 72 6e 6f 20 76 | 61 6c 75 65 20 61 73 20 | errno v|alue as |
|00004b50| 6f 75 72 20 65 78 69 74 | 20 73 74 61 74 75 73 2e |our exit| status.|
|00004b60| 0a 20 2a 2f 0a 0a 6d 61 | 69 6e 28 61 72 67 63 2c |. */..ma|in(argc,|
|00004b70| 20 61 72 67 76 29 0a 69 | 6e 74 09 61 72 67 63 3b | argv).i|nt.argc;|
|00004b80| 0a 63 68 61 72 09 2a 61 | 72 67 76 5b 5d 3b 0a 7b |.char.*a|rgv[];.{|
|00004b90| 0a 09 69 6e 74 09 09 66 | 64 3b 0a 09 65 78 74 65 |..int..f|d;..exte|
|00004ba0| 72 6e 20 69 6e 74 09 65 | 72 72 6e 6f 3b 0a 09 65 |rn int.e|rrno;..e|
|00004bb0| 78 74 65 72 6e 20 63 68 | 61 72 09 2a 70 6e 61 6d |xtern ch|ar.*pnam|
|00004bc0| 65 3b 0a 0a 09 70 6e 61 | 6d 65 20 3d 20 61 72 67 |e;...pna|me = arg|
|00004bd0| 76 5b 30 5d 3b 0a 0a 09 | 69 66 20 28 61 72 67 63 |v[0];...|if (argc|
|00004be0| 20 21 3d 20 34 29 0a 09 | 09 65 72 72 5f 71 75 69 | != 4)..|.err_qui|
|00004bf0| 74 28 22 6f 70 65 6e 66 | 69 6c 65 20 3c 73 6f 63 |t("openf|ile <soc|
|00004c00| 6b 66 64 23 3e 20 3c 66 | 69 6c 65 6e 61 6d 65 3e |kfd#> <f|ilename>|
|00004c10| 20 3c 6d 6f 64 65 3e 22 | 29 3b 0a 0a 09 2f 2a 0a | <mode>"|);.../*.|
|00004c20| 09 20 2a 20 4f 70 65 6e | 20 74 68 65 20 66 69 6c |. * Open| the fil|
|00004c30| 65 2e 0a 09 20 2a 2f 0a | 0a 09 69 66 20 28 20 28 |e... */.|..if ( (|
|00004c40| 66 64 20 3d 20 6f 70 65 | 6e 28 61 72 67 76 5b 32 |fd = ope|n(argv[2|
|00004c50| 5d 2c 20 61 74 6f 69 28 | 61 72 67 76 5b 33 5d 29 |], atoi(|argv[3])|
|00004c60| 29 29 20 3c 20 30 29 0a | 09 09 65 78 69 74 28 20 |)) < 0).|..exit( |
|00004c70| 28 65 72 72 6e 6f 20 3e | 20 30 29 20 3f 20 65 72 |(errno >| 0) ? er|
|00004c80| 72 6e 6f 20 3a 20 32 35 | 35 20 29 3b 0a 0a 09 2f |rno : 25|5 );.../|
|00004c90| 2a 0a 09 20 2a 20 41 6e | 64 20 70 61 73 73 20 74 |*.. * An|d pass t|
|00004ca0| 68 65 20 64 65 73 63 72 | 69 70 74 6f 72 20 62 61 |he descr|iptor ba|
|00004cb0| 63 6b 20 74 6f 20 63 61 | 6c 6c 65 72 2e 0a 09 20 |ck to ca|ller... |
|00004cc0| 2a 2f 0a 0a 09 65 78 69 | 74 28 20 73 65 6e 64 66 |*/...exi|t( sendf|
|00004cd0| 69 6c 65 28 61 74 6f 69 | 28 61 72 67 76 5b 31 5d |ile(atoi|(argv[1]|
|00004ce0| 29 2c 20 66 64 29 20 29 | 3b 0a 7d 0a 27 69 6e 67 |), fd) )|;.}.'ing|
|00004cf0| 20 75 73 29 2e 0a 20 2a | 20 57 65 20 65 78 69 74 | us).. *| We exit|
|00004d00| 28 29 20 77 69 74 68 20 | 61 20 76 61 6c 75 65 20 |() with |a value |
|00004d10| 6f 66 20 30 20 69 66 20 | 61 6c 6c 20 69 73 20 4f |of 0 if |all is O|
|00004d20| 4b 2c 20 6f 74 68 65 72 | 77 69 73 65 20 77 65 20 |K, other|wise we |
|00004d30| 70 61 73 73 20 62 61 63 | 6b 20 74 68 65 0a 20 2a |pass bac|k the. *|
|00004d40| 20 65 72 72 6e 6f 20 76 | 61 6c 75 65 20 61 73 20 | errno v|alue as |
|00004d50| 6f 75 72 20 65 78 69 74 | 20 73 74 61 74 75 73 2e |our exit| status.|
|00004d60| 0a 20 2a 2f 0a 0a 6d 61 | 69 6e 28 61 72 67 63 2c |. */..ma|in(argc,|
|00004d70| 20 61 72 67 76 29 0a 69 | 6e 74 09 61 72 67 63 3b | argv).i|nt.argc;|
|00004d80| 0a 63 68 61 72 09 2a 61 | 72 67 76 5b 5d 3b 0a 7b |.char.*a|rgv[];.{|
|00004d90| 0a 09 69 6e 74 09 09 66 | 64 3b 0a 09 65 78 74 65 |..int..f|d;..exte|
|00004da0| 72 6e 20 69 6e 74 09 65 | 72 72 6e 6f 3b 0a 09 65 |rn int.e|rrno;..e|
|00004db0| 78 74 65 72 6e 20 63 68 | 61 72 09 2a 70 6e 61 6d |xtern ch|ar.*pnam|
|00004dc0| 65 3b 0a 0a 09 70 6e 61 | 6d 65 20 3d 20 61 72 67 |e;...pna|me = arg|
|00004dd0| 76 5b 30 5d 3b 0a 0a 09 | 69 66 20 28 61 72 67 63 |v[0];...|if (argc|
|00004de0| 20 21 3d 20 34 29 0a 09 | 09 65 72 72 5f 71 75 69 | != 4)..|.err_qui|
|00004df0| 74 28 22 6f 70 65 6e 66 | 69 6c 65 20 3c 73 6f 63 |t("openf|ile <soc|
|00004e00| 2e 2f 66 64 2e 73 35 2f | 72 65 63 76 66 69 6c 65 |./fd.s5/|recvfile|
|00004e10| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00004e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00004e70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00004e80| 20 20 20 20 36 35 30 20 | 20 34 35 34 32 37 32 37 | 650 | 4542727|
|00004e90| 32 32 36 20 20 20 37 31 | 33 33 00 20 00 00 00 00 |226 71|33. ....|
|00004ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 2f 2a 0a 20 2a 20 52 65 | 63 65 69 76 65 20 61 20 |/*. * Re|ceive a |
|00005010| 66 69 6c 65 20 64 65 73 | 63 72 69 70 74 6f 72 20 |file des|criptor |
|00005020| 66 72 6f 6d 20 61 6e 6f | 74 68 65 72 20 70 72 6f |from ano|ther pro|
|00005030| 63 65 73 73 2e 0a 20 2a | 20 52 65 74 75 72 6e 20 |cess.. *| Return |
|00005040| 74 68 65 20 66 69 6c 65 | 20 64 65 73 63 72 69 70 |the file| descrip|
|00005050| 74 6f 72 20 69 66 20 4f | 4b 2c 20 6f 74 68 65 72 |tor if O|K, other|
|00005060| 77 69 73 65 20 72 65 74 | 75 72 6e 20 2d 31 2e 0a |wise ret|urn -1..|
|00005070| 20 2a 2f 0a 0a 23 69 6e | 63 6c 75 64 65 09 3c 73 | */..#in|clude.<s|
|00005080| 79 73 2f 74 79 70 65 73 | 2e 68 3e 0a 23 69 6e 63 |ys/types|.h>.#inc|
|00005090| 6c 75 64 65 09 3c 73 74 | 72 6f 70 74 73 2e 68 3e |lude.<st|ropts.h>|
|000050a0| 0a 0a 69 6e 74 0a 72 65 | 63 76 66 69 6c 65 28 73 |..int.re|cvfile(s|
|000050b0| 66 64 29 0a 69 6e 74 09 | 73 66 64 3b 09 09 2f 2a |fd).int.|sfd;../*|
|000050c0| 20 73 74 72 65 61 6d 20 | 70 69 70 65 20 2a 2f 0a | stream |pipe */.|
|000050d0| 7b 0a 09 69 6e 74 09 09 | 09 66 64 3b 0a 09 73 74 |{..int..|.fd;..st|
|000050e0| 72 75 63 74 20 73 74 72 | 72 65 63 76 66 64 09 72 |ruct str|recvfd.r|
|000050f0| 65 63 76 3b 0a 0a 09 69 | 66 20 28 69 6f 63 74 6c |ecv;...i|f (ioctl|
|00005100| 28 73 66 64 2c 20 49 5f | 52 45 43 56 46 44 2c 20 |(sfd, I_|RECVFD, |
|00005110| 28 63 68 61 72 20 2a 29 | 20 26 72 65 63 76 29 20 |(char *)| &recv) |
|00005120| 3c 20 30 29 0a 09 09 72 | 65 74 75 72 6e 28 2d 31 |< 0)...r|eturn(-1|
|00005130| 29 3b 0a 0a 09 72 65 74 | 75 72 6e 28 72 65 63 76 |);...ret|urn(recv|
|00005140| 2e 66 64 29 3b 09 2f 2a | 20 72 65 74 75 72 6e 20 |.fd);./*| return |
|00005150| 74 68 65 20 6e 65 77 20 | 66 69 6c 65 20 64 65 73 |the new |file des|
|00005160| 63 72 69 70 74 6f 72 20 | 2a 2f 0a 09 09 2f 2a 20 |criptor |*/.../* |
|00005170| 77 65 20 64 6f 6e 27 74 | 20 72 65 74 75 72 6e 20 |we don't| return |
|00005180| 74 68 65 20 75 69 64 20 | 61 6e 64 20 67 69 64 20 |the uid |and gid |
|00005190| 74 68 61 74 20 61 72 65 | 20 61 76 61 69 6c 61 62 |that are| availab|
|000051a0| 6c 65 20 2a 2f 0a 7d 0a | 00 5d 00 70 00 08 6e d5 |le */.}.|.].p..n.|
|000051b0| ff ef ed 28 00 02 9e 81 | ff ef e7 b8 00 00 ce 1e |...(....|........|
|000051c0| 00 02 9e 80 00 02 9e 78 | 00 02 9e 5c 00 00 20 00 |.......x|...\.. .|
|000051d0| 00 00 00 01 00 00 6a da | ff ef e7 e8 00 00 6b 00 |......j.|......k.|
|000051e0| 00 02 9e 5c ff ef ed 28 | 00 02 9e 81 ff ef e7 ec |...\...(|........|
|000051f0| 00 00 ce 1e 00 02 9e 80 | 00 02 9e 5c 00 02 9e 58 |........|...\...X|
|00005200| 2e 2f 66 64 2e 73 35 2f | 73 65 6e 64 66 69 6c 65 |./fd.s5/|sendfile|
|00005210| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00005220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00005270| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005280| 20 20 20 20 35 35 33 20 | 20 34 35 34 32 37 32 37 | 553 | 4542727|
|00005290| 32 32 36 20 20 20 37 31 | 32 37 00 20 00 00 00 00 |226 71|27. ....|
|000052a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005400| 2f 2a 0a 20 2a 20 50 61 | 73 73 20 61 20 66 69 6c |/*. * Pa|ss a fil|
|00005410| 65 20 64 65 73 63 72 69 | 70 74 6f 72 20 74 6f 20 |e descri|ptor to |
|00005420| 61 6e 6f 74 68 65 72 20 | 70 72 6f 63 65 73 73 2e |another |process.|
|00005430| 0a 20 2a 20 52 65 74 75 | 72 6e 20 30 20 69 66 20 |. * Retu|rn 0 if |
|00005440| 4f 4b 2c 20 6f 74 68 65 | 72 77 69 73 65 20 72 65 |OK, othe|rwise re|
|00005450| 74 75 72 6e 20 74 68 65 | 20 65 72 72 6e 6f 20 76 |turn the| errno v|
|00005460| 61 6c 75 65 20 66 72 6f | 6d 20 74 68 65 20 49 5f |alue fro|m the I_|
|00005470| 53 45 4e 44 46 44 20 69 | 6f 63 74 6c 2e 0a 20 2a |SENDFD i|octl.. *|
|00005480| 2f 0a 0a 23 69 6e 63 6c | 75 64 65 09 3c 73 79 73 |/..#incl|ude.<sys|
|00005490| 2f 74 79 70 65 73 2e 68 | 3e 0a 23 69 6e 63 6c 75 |/types.h|>.#inclu|
|000054a0| 64 65 09 3c 73 74 72 6f | 70 74 73 2e 68 3e 0a 0a |de.<stro|pts.h>..|
|000054b0| 69 6e 74 0a 73 65 6e 64 | 66 69 6c 65 28 73 74 72 |int.send|file(str|
|000054c0| 66 64 2c 20 66 64 29 0a | 69 6e 74 09 73 74 72 66 |fd, fd).|int.strf|
|000054d0| 64 3b 09 09 2f 2a 20 73 | 74 72 65 61 6d 20 70 69 |d;../* s|tream pi|
|000054e0| 70 65 20 74 6f 20 70 61 | 73 73 20 64 65 73 63 72 |pe to pa|ss descr|
|000054f0| 69 70 74 6f 72 20 6f 6e | 20 2a 2f 0a 69 6e 74 09 |iptor on| */.int.|
|00005500| 66 64 3b 09 09 2f 2a 20 | 74 68 65 20 61 63 74 75 |fd;../* |the actu|
|00005510| 61 6c 20 66 64 20 76 61 | 6c 75 65 20 74 6f 20 70 |al fd va|lue to p|
|00005520| 61 73 73 20 2a 2f 0a 7b | 0a 09 69 66 20 28 69 6f |ass */.{|..if (io|
|00005530| 63 74 6c 28 73 74 72 66 | 64 2c 20 49 5f 53 45 4e |ctl(strf|d, I_SEN|
|00005540| 44 46 44 2c 20 66 64 29 | 20 3c 20 30 29 0a 09 09 |DFD, fd)| < 0)...|
|00005550| 72 65 74 75 72 6e 28 2d | 31 29 3b 0a 0a 09 72 65 |return(-|1);...re|
|00005560| 74 75 72 6e 28 30 29 3b | 0a 7d 0a 09 09 2f 2a 20 |turn(0);|.}.../* |
|00005570| 77 65 20 64 6f 6e 27 74 | 00 02 c0 70 00 02 9e 58 |we don't|...p...X|
|00005580| ff ef e7 ec 00 00 cd 02 | 00 00 21 24 00 02 9e 78 |........|..!$...x|
|00005590| 74 68 61 74 00 00 00 01 | 00 00 21 24 07 0d 03 00 |that....|..!$....|
|000055a0| 00 02 68 3e 41 e8 00 02 | 00 5d 00 70 00 08 6e d5 |..h>A...|.].p..n.|
|000055b0| ff ef ed 28 00 02 9e 81 | ff ef e7 b8 00 00 ce 1e |...(....|........|
|000055c0| 00 02 9e 80 00 02 9e 78 | 00 02 9e 5c 00 00 20 00 |.......x|...\.. .|
|000055d0| 00 00 00 01 00 00 6a da | ff ef e7 e8 00 00 6b 00 |......j.|......k.|
|000055e0| 00 02 9e 5c ff ef ed 28 | 00 02 9e 81 ff ef e7 ec |...\...(|........|
|000055f0| 00 00 ce 1e 00 02 9e 80 | 00 02 9e 5c 00 02 9e 58 |........|...\...X|
|00005600| 2e 2f 66 64 2f 00 00 00 | 00 00 00 00 00 00 00 00 |./fd/...|........|
|00005610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005660| 00 00 00 00 20 34 30 37 | 35 30 20 00 20 20 20 31 |.... 407|50 . 1|
|00005670| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005680| 20 20 20 20 20 20 30 20 | 20 35 30 32 35 37 32 36 | 0 | 5025726|
|00005690| 35 33 37 20 20 20 34 36 | 34 30 00 20 00 00 00 00 |537 46|40. ....|
|000056a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005800| 2e 2f 66 64 2f 6d 79 63 | 61 74 2e 63 00 00 00 00 |./fd/myc|at.c....|
|00005810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005860| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00005870| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005880| 20 20 20 31 31 36 35 20 | 20 34 35 34 32 37 32 37 | 1165 | 4542727|
|00005890| 31 33 36 20 20 31 30 35 | 36 31 00 20 31 2e 2f 66 |136 105|61. 1./f|
|000058a0| 64 2e 73 35 2f 6d 79 63 | 61 74 2e 63 00 00 00 00 |d.s5/myc|at.c....|
|000058b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a00| 2e 2f 66 64 2f 4d 61 6b | 65 66 69 6c 65 00 00 00 |./fd/Mak|efile...|
|00005a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00005a70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005a80| 20 20 20 31 30 36 36 20 | 20 34 35 34 32 37 32 37 | 1066 | 4542727|
|00005a90| 31 33 36 20 20 31 31 31 | 31 37 00 20 31 2e 2f 66 |136 111|17. 1./f|
|00005aa0| 64 2e 73 35 2f 4d 61 6b | 65 66 69 6c 65 00 00 00 |d.s5/Mak|efile...|
|00005ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c00| 2e 2f 66 64 2f 6f 70 65 | 6e 66 69 6c 65 2e 63 00 |./fd/ope|nfile.c.|
|00005c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00005c70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005c80| 20 20 20 31 33 35 34 20 | 20 34 35 34 32 37 32 37 | 1354 | 4542727|
|00005c90| 31 33 37 20 20 31 31 37 | 33 32 00 20 31 2e 2f 66 |137 117|32. 1./f|
|00005ca0| 64 2e 73 35 2f 6f 70 65 | 6e 66 69 6c 65 2e 63 00 |d.s5/ope|nfile.c.|
|00005cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e00| 2e 2f 66 64 2f 6d 79 6f | 70 65 6e 2e 63 00 00 00 |./fd/myo|pen.c...|
|00005e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e60| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00005e70| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00005e80| 20 20 20 32 35 30 35 20 | 20 34 35 34 32 37 32 37 | 2505 | 4542727|
|00005e90| 32 32 35 20 20 31 31 31 | 34 33 00 20 31 2e 2f 66 |225 111|43. 1./f|
|00005ea0| 64 2e 73 35 2f 6d 79 6f | 70 65 6e 2e 63 00 00 00 |d.s5/myo|pen.c...|
|00005eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006000| 2e 2f 66 64 2f 73 65 6e | 64 66 69 6c 65 2e 63 00 |./fd/sen|dfile.c.|
|00006010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006060| 00 00 00 00 20 20 20 36 | 34 30 20 00 20 20 20 31 |.... 6|40 . 1|
|00006070| 33 35 20 00 20 20 20 31 | 36 30 20 00 20 20 20 20 |35 . 1|60 . |
|00006080| 20 20 20 31 34 32 34 20 | 20 34 35 34 32 37 32 37 | 1424 | 4542727|
|00006090| 32 33 30 20 20 20 36 36 | 31 32 00 20 00 00 00 00 |230 66|12. ....|
|000060a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006200| 2f 2a 0a 20 2a 20 50 61 | 73 73 20 61 20 66 69 6c |/*. * Pa|ss a fil|
|00006210| 65 20 64 65 73 63 72 69 | 70 74 6f 72 20 74 6f 20 |e descri|ptor to |
|00006220| 61 6e 6f 74 68 65 72 20 | 70 72 6f 63 65 73 73 2e |another |process.|
|00006230| 0a 20 2a 20 52 65 74 75 | 72 6e 20 30 20 69 66 20 |. * Retu|rn 0 if |
|00006240| 4f 4b 2c 20 6f 74 68 65 | 72 77 69 73 65 20 72 65 |OK, othe|rwise re|
|00006250| 74 75 72 6e 20 74 68 65 | 20 65 72 72 6e 6f 20 76 |turn the| errno v|
|00006260| 61 6c 75 65 20 66 72 6f | 6d 20 74 68 65 0a 20 2a |alue fro|m the. *|
|00006270| 20 73 65 6e 64 6d 73 67 | 28 29 20 73 79 73 74 65 | sendmsg|() syste|
|00006280| 6d 20 63 61 6c 6c 2e 0a | 20 2a 2f 0a 0a 23 69 6e |m call..| */..#in|
|00006290| 63 6c 75 64 65 09 3c 73 | 79 73 2f 74 79 70 65 73 |clude.<s|ys/types|
|000062a0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 79 |.h>.#inc|lude.<sy|
|000062b0| 73 2f 73 6f 63 6b 65 74 | 2e 68 3e 0a 23 69 6e 63 |s/socket|.h>.#inc|
|000062c0| 6c 75 64 65 09 3c 73 79 | 73 2f 75 69 6f 2e 68 3e |lude.<sy|s/uio.h>|
|000062d0| 0a 0a 69 6e 74 0a 73 65 | 6e 64 66 69 6c 65 28 73 |..int.se|ndfile(s|
|000062e0| 6f 63 6b 66 64 2c 20 66 | 64 29 0a 69 6e 74 09 73 |ockfd, f|d).int.s|
|000062f0| 6f 63 6b 66 64 3b 09 09 | 2f 2a 20 55 4e 49 58 20 |ockfd;..|/* UNIX |
|00006300| 64 6f 6d 61 69 6e 20 73 | 6f 63 6b 65 74 20 74 6f |domain s|ocket to|
|00006310| 20 70 61 73 73 20 64 65 | 73 63 72 69 70 74 6f 72 | pass de|scriptor|
|00006320| 20 6f 6e 20 2a 2f 0a 69 | 6e 74 09 66 64 3b 09 09 | on */.i|nt.fd;..|
|00006330| 2f 2a 20 74 68 65 20 61 | 63 74 75 61 6c 20 66 64 |/* the a|ctual fd|
|00006340| 20 76 61 6c 75 65 20 74 | 6f 20 70 61 73 73 20 2a | value t|o pass *|
|00006350| 2f 0a 7b 0a 09 73 74 72 | 75 63 74 20 69 6f 76 65 |/.{..str|uct iove|
|00006360| 63 09 69 6f 76 5b 31 5d | 3b 0a 09 73 74 72 75 63 |c.iov[1]|;..struc|
|00006370| 74 20 6d 73 67 68 64 72 | 09 6d 73 67 3b 0a 09 65 |t msghdr|.msg;..e|
|00006380| 78 74 65 72 6e 20 69 6e | 74 09 65 72 72 6e 6f 3b |xtern in|t.errno;|
|00006390| 0a 0a 09 69 6f 76 5b 30 | 5d 2e 69 6f 76 5f 62 61 |...iov[0|].iov_ba|
|000063a0| 73 65 20 3d 20 28 63 68 | 61 72 20 2a 29 20 30 3b |se = (ch|ar *) 0;|
|000063b0| 09 09 2f 2a 20 6e 6f 20 | 64 61 74 61 20 74 6f 20 |../* no |data to |
|000063c0| 73 65 6e 64 20 2a 2f 0a | 09 69 6f 76 5b 30 5d 2e |send */.|.iov[0].|
|000063d0| 69 6f 76 5f 6c 65 6e 20 | 20 3d 20 30 3b 0a 09 6d |iov_len | = 0;..m|
|000063e0| 73 67 2e 6d 73 67 5f 69 | 6f 76 20 20 20 20 20 20 |sg.msg_i|ov |
|000063f0| 20 20 20 20 3d 20 69 6f | 76 3b 0a 09 6d 73 67 2e | = io|v;..msg.|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.